【发布时间】:2018-03-23 06:42:46
【问题描述】:
这是我的问题和我的项目结构
src
|-->config
|--> config.go
|-->otherPackage
|--> otherFile.go
|-->main.go
我在config.go 上有一个类型,我想在otherFile.go 中使用它
但是当我尝试将其添加到这里的导入时,这些问题:
imported and not used.undefined: Config
虽然我在函数声明中使用了它
function(target float64, entries [2]float64, config Config)
这有什么问题?
我尝试用
导入它import (
"fmt"
"math"
"../config"
)
【问题讨论】:
-
如何导入?
-
@mic4ael 导入,我只是编辑我的帖子以回答您的问题
-
您应该阅读的第一件事是How to Write Go Code
标签: go