export 與 import

package concurrency
import (
"fmt"
)
func Say(s string) {
fmt.Print(s)
}
使用 go mod 的話 import 只要放入 go mod 名稱在前面即可
Last updated

package concurrency
import (
"fmt"
)
func Say(s string) {
fmt.Print(s)
}
Last updated
package main;
import (
concurrency "./concurrency"
)
func main() {
concurrency.Say("hello");
}go mod init test-backendpackage routes
import (
controllers "test-backend/controllers"
)
func CatchphrasesRoute(route fiber.Router) {
route.Get("/", controllers.GetAllCatchphrases)
}