1
0
mirror of https://github.com/golang/go synced 2024-11-20 04:54:44 -07:00
go/src/internal
Carlos Castillo 59e546633d os: Use GetComputerNameEx to get Hostname on win32
The existing Hostname function uses the GetComputerName system
function in windows to determine the hostname. It has some downsides:

  - The name is limited to 15 characters.
  - The name returned is for NetBIOS, other OS's return a DNS name

This change adds to the internal/syscall/windows package a
GetComputerNameEx function, and related enum constants. They are used
instead of the syscall.ComputerName function to implement os.Hostname
on windows.

Fixes #9982

Change-Id: Idc8782785eb1eea37e64022bd201699ce9c4b39c
Reviewed-on: https://go-review.googlesource.com/5852
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Carlos Castillo <cookieo9@gmail.com>
Reviewed-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
2015-02-25 23:16:44 +00:00
..
mime net/mail: move RFC 2047 code to internal/mime 2015-02-23 17:46:37 +00:00
syscall os: Use GetComputerNameEx to get Hostname on win32 2015-02-25 23:16:44 +00:00
trace cmd/trace: add new command 2015-02-20 18:31:25 +00:00