Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 1.03 KB

File metadata and controls

26 lines (20 loc) · 1.03 KB
sr-due 2025-12-28
sr-interval 11
sr-ease 270

#review

little notes (might get shorter)

each go source code begins with a package declaration package main has a meaning, autonomous Go programs should use the main package. the import keyword allows you to include functionality from existing packages. two characteristics of go that makes it able to generate an executable binary:

  1. the name of the package
  2. presence of the main() function.

methods = functions that attached to specific data types

go global rule: everything that begins with a lower-case letter is considered private and it is accessible in the current package only. except packages name which can be named anything but he is not aware of one that starts with capital letters.

two ways of execute go code:

  1. as a compiled language == using go build and then run ./executable_file
  2. mimicking a scripting == language using go run

the go run command builds the named go package, creates a temporary executable file executes that file and deletes it once it is done