Exemple #1
0
// main is the entry point for the application.
func main() {
	// ./example2.go:15: cannot refer to unexported name counters.alertCounter
	// ./example2.go:15: undefined: counters.alertCounter
	counter := counters.alertCounter(10)

	fmt.Printf("Counter: %d\n", counter)
}
Exemple #2
0
// main is the entry point for the application.
func main() {
	// Create a variable of the unexported type and initialize the value to 10.
	counter := counters.alertCounter(10)

	// ./example2.go:17: cannot refer to unexported name counters.alertCounter
	// ./example2.go:17: undefined: counters.alertCounter

	fmt.Printf("Counter: %d\n", counter)
}