Advertisement
Guest User

Untitled

a guest
Apr 7th, 2016
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.33 KB | None | 0 0
  1. func GetRandomLink(host string) string{
  2.     log.Print("My function is used!")
  3.     return "http://example.com/path1"
  4. }
  5.  
  6. type TlinksMap struct{
  7.     GetRandomLink func(host string) string
  8. }
  9.  
  10.  
  11. type generic struct{
  12.     TlinksMap
  13. }
  14.  
  15. func TestBasic(t *testing.T) {
  16.     linksMap = &generic{TlinksMap: &TlinksMap{GetRandomLink: GetRandomLink}}
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement