Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cgo: creat() is typo? #61334

Closed
orangekame3 opened this issue Jul 13, 2023 · 2 comments
Closed

cmd/cgo: creat() is typo? #61334

orangekame3 opened this issue Jul 13, 2023 · 2 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime.

Comments

@orangekame3
Copy link

orangekame3 commented Jul 13, 2023

What version of Go are you using (go version)?

go version go1.20.3 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
❯ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/orangekame3/.cache/go-build"
GOENV="/home/orangekame3/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/orangekame3/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/orangekame3/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build683663421=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I think ⤵ creat() in cmd/cgo/util.go is typo

go/src/cmd/cgo/util.go

Lines 107 to 114 in 49d4212

func creat(name string) *os.File {
f, err := os.Create(name)
if err != nil {
fatalf("%s", err)
}
return f
}

It should be ↓

func create(name string) *os.File {
	f, err := os.Create(name)
	if err != nil {
		fatalf("%s", err)
	}
	return f
}

it's referenced only ⤵
image

What did you expect to see?

none

What did you see instead?

none

@orangekame3
Copy link
Author

orangekame3 commented Jul 13, 2023

Or is it 🤔 ???

https://en.wikiquote.org/wiki/Ken_Thompson#Quotes:~:text=Ken%20Thompson%20was%20once%20asked%20what%20he%20would%20do%20differently%20if%20he%20were%20redesigning%20the%20UNIX%20system.%20His%20reply%3A%20%22I%27d%20spell%20creat%20with%20an%20e.%22

Ken Thompson was once asked what he would do differently if he were redesigning the UNIX system. His reply: "I'd spell creat with an e."

@orangekame3 orangekame3 changed the title cmd/go: creat() is typo? cmd/cgo: creat() is typo? Jul 13, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2023
@orangekame3
Copy link
Author

similar issue is closed
#59501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

2 participants