"Go version"의 두 판 사이의 차이

23번째 줄: 23번째 줄:


func main() {
func main() {
fmt.Printf("go version %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH)
fmt.Printf(runtime.Version())
fmt.Printf(runtime.GOOS)
fmt.Printf(runtime.GOARCH)
}
}
</syntaxhighlight>
</syntaxhighlight>

2023년 10월 16일 (월) 13:11 판

1 개요

Go 버전 확인
go version
  • Go 버전을 출력하는 go 명령어
root@localhost:~# go version
go version go1.19.3 linux/amd64
root@localhost:~# go version
go version go1.12.7 linux/amd64

package main

import (
	"fmt"
	"runtime"
)

func main() {
	fmt.Printf(runtime.Version())
	fmt.Printf(runtime.GOOS)
	fmt.Printf(runtime.GOARCH)
}

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}