DEV Community 👩‍💻👨‍💻

Cover image for Golang perk series : prefix-less functions #2
Lukas Gaucas
Lukas Gaucas

Posted on

Golang perk series : prefix-less functions #2

"GLOBAL" FUNCTIONS :

Omit the global prefix : window in JS, fmt in Go :

In JavaScript :

function main(){
   /* window. */print()
}
main()
Enter fullscreen mode Exit fullscreen mode

In Golang :

package main 

import (
  . "fmt"
)

func main(){
  /* fmt. */Println("123")
} 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

🤔 Did you know?

 
🎙 DEV hosts some podcasts that you can find on our Podcasts page.