]> Cypherpunks repositories - gostls13.git/commit
os, syscall: don't consider stderr output as part of hostname
authorDmitri Shuralyov <dmitshur@golang.org>
Mon, 9 May 2022 03:04:28 +0000 (23:04 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 9 May 2022 18:06:51 +0000 (18:06 +0000)
commit0d410d676dde6cf5f2fc6f78ed7f2c39181d6720
tree8076b69f00ab1d0ac1a9f3bfdca2c47478ab0cc6
parentdcfe57b8c2ff32e3dba99787a81a43657a115011
os, syscall: don't consider stderr output as part of hostname

A successful invocation of the hostname command prints the hostname
to stdout and exits with code 0. No part of the hostname is printed
to stderr, so don't consider it.

This avoids false positive failures in environments where hostname
prints some extraneous information (such as performance warnings)
to stderr, and makes the test a bit more robust.

Fixes #52781.

Change-Id: I46aa6fbf95b6616bacf9c2b5e412b0851b230744
Reviewed-on: https://go-review.googlesource.com/c/go/+/405014
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Jason Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/os/os_test.go
src/syscall/syscall_windows_test.go