티스토리 뷰
맥에서 우분투용 실행파일을 빌드하는 방법은 빌드할 때 다음과 같이 설정값을 전달하고 빌드 명령을 실행하면 됩니다.
GOOS, GOARCH 설정은 runtime 확인을 통해 알아 낼 수 있습니다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ubuntu 용 빌드 | |
GOOS=linux GOARCH=amd64 go build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import "runtime" | |
func main() { | |
fmt.Printf("OS: %s\n", runtime.GOOS) | |
fmt.Printf("Architecture: %s\n", runtime.GOARCH) | |
} |
반응형
'프로그래밍 언어 > go' 카테고리의 다른 글
[golang] MySql 드라이버에서 tls 로 접속하는 방법 (1) | 2023.03.08 |
---|---|
[go] kafka 라이브러리의 크로스 컴파일 오류 undefined: kafka.NewProducer (0) | 2022.06.16 |
[go] 표준 go 프로젝트 레이아웃 (0) | 2022.02.15 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- yarn
- SPARK
- Tez
- hbase
- mysql
- Linux
- HIVE
- HDFS
- java
- AWS
- 다이나믹
- SQL
- build
- Python
- airflow
- 오류
- 하둡
- emr
- ubuntu
- nodejs
- S3
- 파이썬
- 알고리즘
- 정올
- 하이브
- Hadoop
- bash
- error
- oozie
- 백준
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함