반응형
[A Tour of Go 따라하기] 임포트 (Imports)
이 내용은 https://go-tour-kr.appspot.com/ 를 참고합니다.
이 내용은 Windows 환경에서 Go를 사용하며 IDE는 Visual Studio Code 입니다.
임포트 (Imports)
이 코드에서는 여러개의 "package"
를 소괄호로 감싸서 import를 표현합니다.
package main import ( "fmt" "math" ) func main() { fmt.Printf("Now you have %g problems.", math.Nextafter(2, 3)) }
아래와 같이 import 문장을 여러번 사용할 수 도 있습니다.
package main import "fmt" import "math" func main() { fmt.Printf("Now you have %g problems.", math.Nextafter(2, 3)) }
import 관련은 큰 내용은 없는 것 같습니다.
Go언어의 패키지를 import하는 방법을 학습하였습니다.
반응형
'Go > A Tour of Go 따라하기' 카테고리의 다른 글
[A Tour of Go 따라하기] 이름이 정해진 결과 (Named results) (0) | 2019.01.24 |
---|---|
[A Tour of Go 따라하기] 여러 개의 결과 (Multiple results) (0) | 2019.01.24 |
[A Tour of Go 따라하기] 함수 (0) | 2019.01.24 |
[A Tour of Go 따라하기] 익스포트 (Exported names) (0) | 2019.01.24 |
[A Tour of Go 따라하기] 패키지(Packages) (0) | 2019.01.24 |