123456789101112131415161718 |
- // In Go capitalized names are exported, and
- // non capitalized names aren't
- package examples
- import (
- "fmt"
- "math"
- )
- // Exported: function gets exported so to access this
- // outside you must import examples and write
- // examples.Exported()
- func Exported() float64 {
- pi := math.Pi // This is an exported constant from math module
- fmt.Printf("%g\n", pi)
- return pi
- }
|