Created
January 4, 2014 19:44
-
-
Save jamesharr/8259755 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"play/pkgaccess/pkg" | |
) | |
func main() { | |
fmt.Println(pkg.Bar) // Huh, I an access it | |
lcl := pkg.Bar // Huuuh, I can create a copy of it. | |
fmt.Println(lcl) | |
var lcl2 pkg.foo // But I can't declare one. Compile error: cannot refer to unexported name "pkg.foo" | |
fmt.Println(lcl2) | |
} | |
/* | |
// File: play/pkgaccess/pkg/asdf.go | |
package pkg | |
type foo struct { | |
Foo int | |
} | |
var Bar = foo{1} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment