Tobias Klauser
ecada54126
unix: use slices.{Equal,Sort} in tests
...
Same as CL 587655 and CL 690475 did for package syscall tests.
Change-Id: Ie3c8726a4e2c859b5d7992ea1baec14083b9fdba
Reviewed-on: https://go-review.googlesource.com/c/sys/+/708558
Reviewed-by: Junyang Shao <shaojunyang@google.com >
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Sean Liao <sean@liao.dev >
2025-10-02 11:15:31 -07:00
Tobias Klauser
01aaa8342f
all: simplify code by using modern Go constructs
...
Generated using modernize by running:
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
Change-Id: Ifc7d61cf6735cc53f2bdf890a338961f55075af5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/661975
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
2025-04-03 13:04:48 -07:00
Meng Zhuo
f69d32aa92
unix: in TestDirent, make as many ReadDirent calls as are needed
...
This CL just port CL 376334 from main repo with minor modification.
Fixes golang/go#65015
Change-Id: I327d33bde39a2fcb818e28bcb7ff524ca19c4a38
Reviewed-on: https://go-review.googlesource.com/c/sys/+/554875
Reviewed-by: Bryan Mills <bcmills@google.com >
Run-TryBot: M Zhuo <mzh@golangcn.org >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2024-01-10 01:52:35 +00:00
Dmitri Shuralyov
1bfbee0e20
all: update go directive to 1.18
...
Done with:
go get go@1.18
go mod tidy
go fix ./...
Using go1.21.3.
Also update code generators to use only the new go:build lines,
not the old +build ones.
For golang/go#60268 .
Change-Id: I6aabc42efb6ab3329981100e1db2263aac5e92a6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/534222
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-10-11 21:54:30 +00:00
Kir Kolyshkin
fdc7ef4071
all: remove ioutil usage from tests
...
This removes the remaining (and trivial) use of deprecated ioutil
package from test files.
Replacements are easy:
ioutil.ReadAll -> io.ReadAll
ioutil.ReadDir -> os.ReadDir
ioutil.ReadFile -> os.ReadFile
ioutil.WriteFile -> os.WriteFile
While at it, simplify some error reporting.
Change-Id: I60a242fd3c08d8fe571a18f16716439a9acdd59d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526299
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Heschi Kreinick <heschi@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
2023-09-12 16:41:27 +00:00
Kir Kolyshkin
0e97d69659
all: use t.TempDir in tests
...
This removes all usage of ioutil.TempDir in tests (and a few cases of
os.TempDir as well, while we're at it), which simplifies test cleanup a
lot.
Compile tested (go test -c) for most platforms (except zos).
Change-Id: I9178f5ec615c0a6cfef36e8de78c6b72e055b7cb
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526297
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Cherry Mui <cherryyz@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: qiulaidongfeng <2645477756@qq.com >
Auto-Submit: Ian Lance Taylor <iant@golang.org >
2023-09-08 15:25:11 +00:00
dustin-ward
95e765b1cc
x/sys/unix: make ReadDirent available on zOS
...
Currently ReadDirent is not available on zOS. This implementation modifies the current darwin implementation to work on zOS.
Also make tests available on zOS.
Fixes golang/go#54528
Fixes golang/go#54587
Change-Id: I62a09d0068ec8c5fdc849a411ce43bdf14ca3926
Reviewed-on: https://go-review.googlesource.com/c/sys/+/424778
Reviewed-by: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Joedian Reid <joedian@golang.org >
Reviewed-by: Bill O'Farrell <billotosyr@gmail.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2022-10-13 17:17:32 +00:00
Russ Cox
9a76102bfb
all: go fmt ./...
...
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).
Not strictly necessary but will avoid spurious changes
as files are edited.
Part of //go:build change (#41184 ).
See https://golang.org/design/draft-gobuild
Change-Id: I01667f826428426a39c84717d02efa25fa44553c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/294490
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Keith Randall <khr@golang.org >
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Trust: Josh Bleecher Snyder <josharian@gmail.com >
Trust: Russ Cox <rsc@golang.org >
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com >
Run-TryBot: Russ Cox <rsc@golang.org >
2021-02-20 05:07:31 +00:00
Tobias Klauser
8f4f963083
unix: merge implementation for ReadDirent
...
Provide common implementation for ReadDirent based on Getdents for
aix, *bsd and linux.
Add Getdents on aix as a wrapper around getdirent.
Keep the implementation for ReadDirent based on Getdirentries for
darwin and dragonfly.
Change-Id: I09094156a1452118ba48af4f14dfe44b1ab745d3
Reviewed-on: https://go-review.googlesource.com/c/sys/+/182321
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
2019-06-21 18:36:46 +00:00