Go Language Observations - Part1

"Go language"

  • ‘Go test’ recompiles each package along with any files with names matching the file pattern “*_test.go”. These additional files can contain test functions, benchmark functions, and example functions.
  • Test case function syntax, func TestXXX(t *testing.T) {…}
  • Benchmark function syntax, func BenchmarkXXX(b *testing.B) {…}
  • Example function syntax, func ExampleXXX()
  • Go can be used for system programming.
  • Go is good fit for game server development
  • Go can be used for Complex event processing.
  • Go is also a general programming language, useful for solving text-processing problems, making frontends, or even scripting-like applications.
  • Go is not suited for real-time softwares because of its garbage collection and automatic memory allocation.
  • The “_” itself is a special identified, called the blank identifier.
  • Statements doesn’t need to end with a “;”, However writing multiple statements in one line (a practice with is not encouraged for readbility reasons), they must be separated by “;”.
  • Interpreted string leterals are character sequences between double quotes “”.
  • main function is the entry point for the executable programs.
  • Each go application contains one package called main.
  • main has no parameters and no return types.
  • Function names only start with a capital letter when the function has to be used outside the package; then they follow PascalCasing, otherwise they follow camelCasing. Every new word in the name starts with a Capital letter.
  • If multiple packages are needed, they can each be imported by a separate statement.
Go Language import packages
1
2
3
4
import (
  "fmt"
  "os"
)

Comments