Skip to content

inertial-frame/go_refresh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go_refresh

Go 1.14.1

This contains personal notes for Go along with course code.

  1. courses contains Coursera and schoolwork code.
  2. experiments contains some code I used to experiment with and learn about Go concepts involving REST API's a long time ago.
  3. examples contains some recent examples demonstrating how to do basic things including the topics below.

Note: executing the supplied Go code requires navigating to PROJECT_DIR/src or setting the GO_PATH appropriately.

Floats

Use decimals when multiplying floats. Go to.

OOD

Go does not have inheritance - polymorphism is achieved through flexible structs where an attribute plays the role of a type. Go to.

Encapsulation is achieved using structs, keeping method and type names lowercase (to prevent exporting), and using receivers. Go to.

Array and Maps Initialization

Use make() for Arrays and Maps:

  1. Arrays
  2. Maps

Input

Use:

bscan := bufio.NewScanner(os.Stdin)

// Continually reads input - try multiple times
for bscan.Scan() { }

Or for singular inputs:

fileName := ""
fmt.Println("Enter filename!")
fmt.Scan(&fileName)

About

Go experiments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 97.3%
  • HTML 2.5%
  • CSS 0.2%