-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathexport.go
More file actions
42 lines (31 loc) · 747 Bytes
/
export.go
File metadata and controls
42 lines (31 loc) · 747 Bytes
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
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) Efficient Go Authors
// Licensed under the Apache License 2.0.
package main
// Examples of private and public constructs.
// Read more in "Efficient Go"; Example 2-2.
const privateConst = 1
const PublicConst = 2
var privateVar int
var PublicVar int
func privateFunc() {}
func PublicFunc() {}
type privateStruct struct {
privateField int
PublicField int
}
func (privateStruct) privateMethod() {}
func (privateStruct) PublicMethod() {}
type PublicStruct struct {
privateField int
PublicField int
}
func (PublicStruct) privateMethod() {}
func (PublicStruct) PublicMethod() {}
type privateInterface interface {
privateMethod()
PublicMethod()
}
type PublicInterface interface {
privateMethod()
PublicMethod()
}