From 8a90fd3c72e7853a39ba348c0cd278b2d11ea610 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Mon, 4 Apr 2011 23:42:14 -0700 Subject: os: New Open API. We replace the current Open with: OpenFile(name, flag, perm) // same as old Open Open(name) // same as old Open(name, O_RDONLY, 0) Create(name) // same as old Open(name, O_RDWR|O_TRUNC|O_CREAT, 0666) This CL includes a gofix module and full code updates: all.bash passes. (There may be a few comments I missed.) The interesting packages are: gofix os Everything else is automatically generated except for hand tweaks to: src/pkg/io/ioutil/ioutil.go src/pkg/io/ioutil/tempfile.go src/pkg/crypto/tls/generate_cert.go src/cmd/goyacc/goyacc.go src/cmd/goyacc/units.y R=golang-dev, bradfitzwork, rsc, r2 CC=golang-dev https://golang.org/cl/4357052 --- src/pkg/path/filepath/path_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pkg/path/filepath/path_test.go') diff --git a/src/pkg/path/filepath/path_test.go b/src/pkg/path/filepath/path_test.go index 7ef69461ee..b3b6eb5aba 100644 --- a/src/pkg/path/filepath/path_test.go +++ b/src/pkg/path/filepath/path_test.go @@ -249,7 +249,7 @@ func walkTree(n *Node, path string, f func(path string, n *Node)) { func makeTree(t *testing.T) { walkTree(tree, tree.name, func(path string, n *Node) { if n.entries == nil { - fd, err := os.Open(path, os.O_CREAT, 0660) + fd, err := os.Create(path) if err != nil { t.Errorf("makeTree: %v", err) } -- cgit v1.3-5-g9baa