Answer the question
In order to leave comments, you need to log in
Import code into main file?
Good afternoon.
Just started learning Go and faced a difficult task. How to import all packages from a directory into the main file. But the number of packages in the directory is unknown:
package main
import{
"/packages" // Из этой папки нужно импортировать все пакеты
}
func main(){
import("/packages/pack") // Загрузить код из этого файла
}
Answer the question
In order to leave comments, you need to log in
1) Why import them? If you don't use them.
2) As soon as you start using them, they can be automatically imported via goimports
3) Display all directories in the console and write the output of the console function to a file. For example, like this:dir /AD /B > myfile
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question