blob: 41b0485551a1dac383ab4990b6b1eefeec748b30 [file] [log] [blame]
A module with a single package that is below the module root.
-- go.mod --
module example.com/single
-- README.md --
This is the README for a test module.
-- LICENSE --
$MITLicense
-- pkg/file1.go --
// Package pkg is a sample package.
package pkg
import "time"
// Version is the same as the module version.
const Version = "v1.0.0"
// F is a function.
func F(t time.Time, s string) (T, u) {
x := 3
x = C
}
// G is new in v1.1.0.
func G() int {
return 3
}
-- pkg/file2.go --
package pkg
var V = Version
type T int
type u int
-- pkg/example_test.go --
package pkg_test
// Example for the package.
func Example() {
fmt.Println("hello")
// Output: hello
}
// A function example.
func ExampleF() {
pkg.F()
}