User Tools

Site Tools


go:tooling:go_run

go run

What is it?

`go run` compiles your code temporarily and runs it immediately, without producing a permanent binary.

What is it used for?

  • Quick local development runs.
  • Trying out a single file or a small package.

Examples

  • Run the project:
    go run .
 
  • Run a single file:
    go run main.go
 
  • Pass arguments:
    go run . --port=8080
 

Notes

`go run` is great for local dev. For real deployment, use `go build` to produce a stable binary.

Hard words (English)

  • compile /kəmˈpaɪl/: biên dịch
  • temporary /ˈtempəreri/: tạm thời
  • argument (arg) /ˈɑːrɡjumənt/: tham số truyền vào
  • local /ˈloʊkəl/: máy cá nhân/môi trường local
  • stable /ˈsteɪbəl/: ổn định
go/tooling/go_run.txt · Last modified: by phong2018