Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
8f37c884
Commit
8f37c884
authored
Aug 22, 2011
by
Tarmigan Casebolt
Committed by
Rob Pike
Aug 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gofix: osopen: fixed=true when changing O_CREAT
R=rsc, r CC=golang-dev
https://golang.org/cl/4921047
parent
07490c0f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
src/cmd/gofix/osopen.go
src/cmd/gofix/osopen.go
+1
-0
src/cmd/gofix/osopen_test.go
src/cmd/gofix/osopen_test.go
+23
-0
No files found.
src/cmd/gofix/osopen.go
View file @
8f37c884
...
...
@@ -31,6 +31,7 @@ func osopen(f *ast.File) bool {
// Rename O_CREAT to O_CREATE.
if
expr
,
ok
:=
n
.
(
ast
.
Expr
);
ok
&&
isPkgDot
(
expr
,
"os"
,
"O_CREAT"
)
{
expr
.
(
*
ast
.
SelectorExpr
)
.
Sel
.
Name
=
"O_CREATE"
fixed
=
true
return
}
...
...
src/cmd/gofix/osopen_test.go
View file @
8f37c884
...
...
@@ -54,6 +54,29 @@ func f() {
os.OpenFile(a, os.O_SURPRISE|os.O_CREATE, 0666)
_ = os.O_CREATE
}
`
,
},
{
Name
:
"osopen.1"
,
In
:
`package main
import (
"os"
)
func f() {
_ = os.O_CREAT
}
`
,
Out
:
`package main
import (
"os"
)
func f() {
_ = os.O_CREATE
}
`
,
},
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment