[A Tour of Go 따라하기] 임포트 (Imports) :: IdeaFusion
반응형

[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하는 방법을 학습하였습니다.

반응형

+ Recent posts