Added golang note

This commit is contained in:
Nik Afiq 2025-07-10 20:30:27 +09:00
parent aa6568149b
commit 48e1760230

31
memo/golang.md Normal file
View File

@ -0,0 +1,31 @@
# Golang basics
## Initialize project
```bash
$ go mod init <project-name> #usually folder name
```
## Insert package
```go
package main
import "fmt"
func main() {
// your code here
}
```
## Running code
```bash
$ go run main.go
```
## Pointer in Go
```go
var userName string
var userTickets int
fmt.Scan(&userName)
// &userName point to the memory of the var
```