You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's talk more about pointers! We've been working on a linked list in Go (https://github.com/osscda/lets-go-project) using pointers over the last 3 weeks (#10, #12, #14, #15 ), and we're going to continue that discussion this week.
Last week:
Talked about different way to implement the item struct to keep track of total items in the list
Review of tests
Introduced slices: go built in method of list []TYPE .. list of type so list of strings with []string {}
Updated testing
Introduced range: range works on maps and lists.
Talking about arrays and slices differences. Fixed sizes for arrays, program won't compile if specify out of bounds index.
Introduced export - captilizing it available for use for anyone else using the library. used with IndexNotFoundError struct
Introduced fmt.Sprintf doesn't print to standard out, returns it as a string (S)
Returning nil as a pattern to say there was no error
Introduced profiles in VS Code, workspace specific so you can check in launch.json and figure out debugging/extensions that are needed
Reviewed gopl problems:
removed unreachable code
anytime we export something (public code) we should have documented in comments because it ends up in the official go documentation. added comments for all the reported problems.
built replace function and added testing
Agenda
Talk about functional programming
Call method with receiver nil
Build Delete function
Build Insert function
Notes
range gives us an index and the value, use
_ explicitly not caring about something
idx if care about the index (or other applicable name)
Let's talk more about pointers! We've been working on a linked list in Go (https://github.com/osscda/lets-go-project) using pointers over the last 3 weeks (#10, #12, #14, #15 ), and we're going to continue that discussion this week.
Last week:
Agenda
Notes
range gives us an index and the value, use
_ explicitly not caring about something
idx if care about the index (or other applicable name)
%d - holder for decimal
documentation for the printing in use with testing -> https://pkg.go.dev/fmt?tab=doc
Talked about differences in the struct and the meta about talking about the package itself.
The challenge of indices and where you want
Lots of repeating code, refactor!
Implement getItemAtIndex
if you are returning more than one thing (), if just one you don't need ()
cached tests
creating helpers for tests
Delete has a lot of boundary conditions. What if list has a single element, what if the list is nil.
Rules of the Stream
The text was updated successfully, but these errors were encountered: