package main
import "fmt"
func main() {
type (
fullGram int
fullKilogram int
fullTon int
)
var (
salt fullGram = 100
apples fullKilogram = 5
truck fullTon = 10
)
fmt.Printf("salt: %d, apples: %d, truck: %d\n", salt, apples, truck)
salt = fullGram(weights.callGram(100))
fmt.Printf("Type of weights.Gram: %T\n", weights.callGram(1))
}
package weight
type (
callGram int
callKilogram int
callTon int
)
我正在开发一个简单的代码程序,该程序应该从另一个自定义文件调用类型。我遇到的问题是,每当我尝试导入路径时,/Users/inanc/go/src/github.com/inancgumus/learngo/weights我的应用程序都会在我尝试保存文件时立即删除导入。
因此,我永远无法正确调用该文件。
墨色风雨
相关分类