Hi,

The following example shows that go files cannot be nested in a
package. Is it so that the go files in a package must be at the root
level of the package?

==> main.go <==
// vim: set noexpandtab tabstop=2:

package main

import (
    "fmt"
    "./mypackage"
)

func main() {
    fmt.Println(mypkg.Add(1, 2))
    fmt.Println(mypkg.Double(2))
}
==> mypackage/myfile/myfile.go <==
// vim: set noexpandtab tabstop=2:

package mypkg

func Add(x, y int) int {
    return x + y
}

==> mypackage/myfile2/myfile2.go <==
// vim: set noexpandtab tabstop=2:

package mypkg

func Double(x int) int {
    return Add(x, y)
}


-- 
Regards,
Peng

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to