1 // Copyright 2020 ChaiShushan <chaishushan{AT}gmail.com>. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package main 6 7 import ( 8 "fmt" 9 ) 10 11 func Example_gopkgPath() { 12 fmt.Println(gopkgPath(".")) 13 fmt.Println(gopkgPath("../..")) 14 fmt.Println(gopkgPath("../..//examples/hi")) 15 16 // Output: 17 // github.com/chai2010/gettext-go/cmd/xgettext-go 18 // github.com/chai2010/gettext-go 19 // github.com/chai2010/gettext-go/examples/hi 20 } 21 22 func Example_gopkgFiles() { 23 fmt.Println(gopkgFiles(".")) 24 fmt.Println(gopkgFiles("../../examples/hi")) 25 26 // Output: 27 // [main.go pkg.go utils.go] 28 // [hi.go] 29 } 30