레이블이 filename인 게시물을 표시합니다. 모든 게시물 표시
레이블이 filename인 게시물을 표시합니다. 모든 게시물 표시

golang filename rules

# golang 파일을 생성할때 파일리스트 특정 파일을 가장 위쪽에 보려고 
# _aaa.go 와 같이 _로 시작하는 파일을 만들고 go build(run) 하면
# 다음과 같이 파일을 찾지 못한다.
package command-line-arguments: no Go files in /xxxx

# 찾아보니 .go .c 등의 파일은 _ 나 . 로 시작하면 대상에서 제외된다.
// Import returns details about the Go package named by the import path,
// interpreting local import paths relative to the srcDir directory.
// If the path is a local import path naming a package that can be imported
// using a standard import path, the returned package will set p.ImportPath
// to that path.
//
// In the directory containing the package, .go, .c, .h, and .s files are
// considered part of the package except for:
//
// - .go files in package documentation
// - files starting with _ or . (likely editor temporary files)
// - files with build constraints not satisfied by the context
//
# 출처

# 추가로 패키지 이름은 _ 나 대소문자구분 없이 모두 소문자로 사용한다.
Good package names are short and clear. They are lower case, with no under_scores or mixedCaps.