A sample project showing the Go user object, various values returned, and also how to parse that into JSON and write it into a file.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Thrashing Code Repo 1

I put together this project in recent video stream starting at 1:32:40.

Here's the time slices with respective topics pertinent to this repo, for the full video head over to youtube to watch it.

1:32:40 - Creating a new application with Jetbrains Goland to show off how to use the Go core libraries around the user, JSON, and some basic file creation and writing.

1:36:40 - At this point I start adding some basic code to pull the current user and collect some information about that user.

1:40:42 - I extract the error code using the Goland refactoring feature and setup a func check() for error checking. That cleans up the inline code a bit.

1:43:10 - Here I add to the user data retrieved some environment variables to that list of collected data. I also cover again, as I have a number of times, how the environment variables are pulled in IDE versus user session versus out of IDE.

1:47:46 - Now I add a file exists check and start working on that logic.

1:48:56 - Props to Edd Turtle on a solid site on Go. Here's the blog entry, and respectively the path to more of Edd's material @ https://golangcode.com/. Also, Edd seems like a good guy to follow @eddturtle.

2:01:33 - Starting the JSON Work here to marshal and unmarshall.

2:26:33 - At this point I push the code up to Github using the built in Goland VCS features. I realize I've named the repo "adron" by accident so I rename it, close Goland, and then clone the code back down locally with Goland's VCS features. It's kind of interesting to see Goland go through the 2-factor auth for this too.

2:58:56 - The Seattle Thrashing Code outtro.