Error in importing custom packages in Go Lang

前端 未结 3 349
有刺的猬
有刺的猬 2021-02-01 13:11

I have created a library by the name libfastget which is in the src with my program as

src
|-libfastget
|  |-libfastget.go
|
|-MainPro         


        
3条回答
  •  时光取名叫无心
    2021-02-01 13:42

    1. set the current directory as GOPATH
    2. or you can use local import as follows


      move your main.go to the ../ directory to the libfastget.go.
      i mean the files looks like:
      src
      |-libfastget
      | |-libfastget.go
      |
      |-main.go

    import "./libfastget"

提交回复
热议问题