Skip to content

Instantly share code, notes, and snippets.

@petrjahoda
Created August 14, 2021 07:20
Show Gist options
  • Save petrjahoda/fec618e230a12c0eeab888e510ae3451 to your computer and use it in GitHub Desktop.
Save petrjahoda/fec618e230a12c0eeab888e510ae3451 to your computer and use it in GitHub Desktop.
1. The basics
package main
import "fmt"
type Car struct {
name string
}
type Truck struct {
name string
}
func main() {
bmw := Car{name: "bmw is the best car"}
volvo := Truck{name: "volvo is the best truck"}
fmt.Println(bmw.name)
fmt.Println(volvo.name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment