Go有部分课程吗?

Are there partial classes in Go?

Like the one here in C#? http://msdn.microsoft.com/en-us/library/wa80x488.aspx

I suppose there isn't any as you cannot partially declare structs.

The method declarations for a type do not need to be in the same source file as the type declaration or other method declarations for the type. The method declarations do need to be in the same package as the type declaration.

A type declaration cannot be split across files.

Go does not have classes.

in go you can have a method associated with any type within the same package in any file. take this small example of object foo with function Bar.

package main
import "fmt"

type foo struct {} // put variables associated with the type here
func ( /*f*/ foo) Bar() { // put a value infront of foo if u need to access any elements in the object
    // do something interesting
    fmt.Println("Method called :D")
}

func main() {
    example := foo{}
    example.bar()
}

aslong as foo and bar declartions occur in the same package they can be placed in any file.

i hope this demonstrated the desired functionality you are trying to implement / wondering if go can support.