There is a structure:
/golang --/project ----main.go ----/init ------start.go ----/init2 ------start2.go There is an error:
cannot find package c:\golang\project\init\project\init2 Main main.go file:
package main import ( "./project/init" ) func main() { stat.Valid() } And broker start.go :
package stat import ( "./project/init2" // Π Π²ΠΎΡ ΡΡΡ Ρ Ρ
ΠΎΡΡ ΠΈΠΌΠΏΠΎΡΡΠΈΡΠΎΠ²Π°ΡΡ init2 Π½ΠΎ ΠΌΠ½Π΅ Π½Π΅ Π΄Π°Π΅Ρ ΠΈΠΌΠΏΠΎΡΡΠΈΡΠΎΠ²Π°ΡΡ, ΠΈΠ±ΠΎ Π²ΡΡΠΊΠ°ΠΊΠΈΠ²Π°Π΅Ρ ΠΎΡΠΈΠ±ΠΊΠ° cannot find package c:\golang\project\init\project\init2 ) func Valid() { stat_two.Valid2() // Π΄ΠΎΠ»ΠΆΠ΅Π½ ΠΈΠΌΠΏΠΎΡΡΠΈΡΠΎΠ²Π°ΡΡΡΡ ΠΏΠ°ΠΊΠ΅Ρ stat_two ΠΈ ΡΡΠ½ΠΊΡΠΈΡ Valid2 } And start2.go :
package stat_two import ( "fmt" ) func Valid2() { fmt.Println("succ import!") } As I understood, another address is added to the address of the directory and it turns out to be c:\golang\project\init\project\init2 . How can I import another directory that is not in the current directory? To get c:\golang\project\init2 ?