$ cat hello.go package main import "fmt" func main() { fmt.Println("Hello world") hello() } $ cat func.go package main import "fmt" func hello() { fmt.Println("Hello world 2") } $ go run . go: go.mod file not found in current directory or any parent directory; see 'go help modules' $ go mod init go: creating new go.mod: module go2 go: to add module requirements and sums: go mod tidy $ go run . Hello world Hello world 2 |
'Programming > golang' 카테고리의 다른 글
golang unused import (0) | 2022.07.20 |
---|---|
golang websocket package (0) | 2022.07.15 |
golang module (0) | 2022.04.13 |
golang 구조체 (0) | 2022.04.11 |
golang defer와 if (0) | 2022.04.11 |