/
2025-03-13 Meeting notes

2025-03-13 Meeting notes

 Date

Mar 13, 2025

 Participants

  • @Tyler Hill

  • @Josh

  •  

 Agenda

 Discussion topics

Item

Notes

Item

Notes

GoLang Review

GoLang Continued

  • Errors

    • GoLang is very explicit in error handling

    • If a function you call has the possibility to return an error, you must check for it, lest the compiler be mad

  • Pointers: https://go.dev/tour/moretypes/1

    • Type safe so can’t do

      • Pointer arithmatic

      • Explicit typing prevents incorrect conversions

  • struct

    • No inheritance but there is composition (include fields from one struct in another)

    • Can declare with values in order of the fields or explicity

      • Vertex{1, 2} and Vertex{X:1, Y:2} are the same

      • Undeclared values default to 0 for numeric and nil for others

    • Access a struct when it is a pointer with V.X instead of V->X

  • Arrays

    • Fixed size, low level

    • Is an array when given a size. ex. var x [2]int

  • Slices

    • Resizable

    • Is a slice when not given a size. ex. var x []int

    • Resizing can be done with s = s[x:y] syntax where x and y represent the start and end of the resizing

      • Elements cut off from the end can be recovered by enlarging the array

      • Cutting off elements from the front discards them

    • make: create an underlying array

      • can set capacity and length (number to initialize)

      • slice of a slice is a reference to a reference which means its referring to the same base array

      • indexing beyond the length is allowed as long as it is within the capacity

    • append

      • adds values, increasing capacity when necessary

        • doubles the capacity when needed

      • does not modify the slice, creates a new one that must be assigned

        • s = append(s, 0)

Questions

 Decisions

 Action items

Related content