K
K
Ken Jee2017-07-16 16:41:39
go
Ken Jee, 2017-07-16 16:41:39

How to specify for Golang the ability to use files from the src of the project?

The Golang SDK itself is installed in C:\Go , and the project lies, for example, in D:\Proj and the project folder contains the src directory , which contains the files used in the project... The essence of the problem is this:

main.go:5:2: cannot find package "Proj/src" in any of:
  C:\Go\src\Proj\src (from $GOROOT)
  C:\Go\bin\src\Proj\src (from $GOPATH)

Contents of file D:\Proj\main.go
package main

import (

  "Proj/src"

)


func main()  {

}

The problem is approximately clear... Proj/src is looked for inside the SDK folder. How to make it so that more packages are searched in the src of the project itself?
OS: Windows
IDE: Gogland

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RidgeA, 2017-07-16
@Machez

1. Non-idiomatic path - specify relative paths - "./Proj/src"
2. Follow the recommendation https://golang.org/doc/code.html

A
Alexander Trakhimenok, 2017-07-16
@astec

I make a symlink from C:\Go to D:\Proj\src

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question