Go Exported names

1 개요[ | ]

Go Exported names
Go 내보내지는 이름, Go 내보내진 이름
  • Go에서 변수명이 대문자로 시작하면 내보내진다(export).
  • 예를 들어, math 패키지에 있는 [math]\displaystyle{ Pi }[/math]는 내보내진 이름이다.
  • Pizza는 내보내진 이름이다.
  • pipizza는 대문자로 시작하지 않으므로 내보내지지 않는다.
  • 패키지를 가져올 때, 내보내진 이름만 참조할 수 있다.
  • 내보내지지 않은 이름은 패키지 외부에서 접근할 수 없다.
package main

import (
	"fmt"
	"math"
)

func main() {
	fmt.Println(math.Pi)
}

2 같이 보기[ | ]

3 참고[ | ]

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