From 48e17602304955aff8faad5d1eccadce509f943d Mon Sep 17 00:00:00 2001 From: Nik Afiq Date: Thu, 10 Jul 2025 20:30:27 +0900 Subject: [PATCH] Added golang note --- memo/golang.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 memo/golang.md diff --git a/memo/golang.md b/memo/golang.md new file mode 100644 index 0000000..3025001 --- /dev/null +++ b/memo/golang.md @@ -0,0 +1,31 @@ +# Golang basics +## Initialize project +```bash +$ go mod init #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 +``` +