Introduction
<!-- A Sample Program -->WARNING: Unported Hugo shortcode (manual conversion needed):
{{< note title="Hello World">}}
A sample go program is show here.
package main
import "fmt"
func main() {
message := greetMe("world")
fmt.Println(message)
}
func greetMe(name string) string {
return "Hello, " + name + "!"
}
Run the program as below:
$ go run hello.go
<!-- Declaring Variables -->WARNING: Unported Hugo shortcode (manual conversion needed):
{{< /note >}}
WARNING: Unported Hugo shortcode (manual conversion needed):
{{< note title="Variables" >}}
Normal Declaration:
var msg string
msg = "Hello"
Shortcut:
msg := "Hello"
<!-- Declaring Constants -->WARNING: Unported Hugo shortcode (manual conversion needed):
{{< /note >}}
WARNING: Unported Hugo shortcode (manual conversion needed):
{{< note title="Constants" >}}
const Phi = 1.618
WARNING: Unported Hugo shortcode (manual conversion needed):
{{< /note >}}