Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. utils(pkg)
  2. | auth.go (has a function names test1)
  3. controllers(pkg)
  4. | login.go (has a function names test2)
  5.  
  6. import "../utils"
  7.  
  8. func test2(c *gin.Context) bool{
  9. utils.test1()
  10. }
  11.  
  12. package utils
  13.  
  14. func Test1() string {
  15. return "Test1"
  16. }
  17.  
  18. package controllers
  19.  
  20. import "project1/utils"
  21.  
  22. func Test2() string {
  23. return utils.Test1()
  24. }
  25.  
  26. package main
  27.  
  28. import (
  29. "fmt"
  30. "project1/controllers"
  31. )
  32.  
  33. func main() {
  34. fmt.Println(controllers.Test2())
  35. }
  36.  
  37. Test1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement