Golang包导入

I am attempting to get the following code to compile:

package main

import (
    "fmt"    
    "code.google.com/p/go.text/unicode/norm"
)

func main() {
    fmt.Println(norm.IsNormalString("ŋ̊"))
}

I have installed the unicode/norm package. I compile with the command:

go build -o ipa ipa.go

Unfortunately, I get the following error:

# command-line-arguments
./ipa.go:9: undefined: norm.IsNormalString
make: *** [ipa] Error 2

It seems that the package is being imported correctly, but I cannot access any of its members. I have tried changing the method from being called to another from norm, but I still get the error. This leads me to believe that I'm fundamentally misunderstanding something about go's package system.

func (Form) IsNormalString

func (f Form) IsNormalString(s string) bool

IsNormalString returns true if s == f(s).

IsNormalString is not a function, it's a method on type Form. For example,

package main

import (
    "code.google.com/p/go.text/unicode/norm"
    "fmt"
)

func main() {
    fmt.Println(norm.NFC.IsNormalString("ŋ̊"))
}

Output:

true