Sharing my journey to improve my Go skills with 100 day focus. I hope you will learn, teach or contribute as we grow in the community together!
This should take you 60 min, and you can expect to learn how to setup a Go development enviornment and basic Git Hub Actions.
Time: 15 minutes
After you install both here is a screen shot of what it should look like after you run go version
Time: 10 minutes
Clone the existing repositiory to have the hello world go application, and the yml files needed for the github action.
git clone https://github.com/Cobra16319/100_Days_Of_Go.git
Use git tags to iterate with the CI system and track any changes updating the yml file logically as needed.
git tag v1
git push --tags
The focus today is learning Goroutines, how to write files, fetching data from an api, wait group and channels. Take some time and look at the code and anaylis what is going on. I am cobra16319 on the Go Discord as well.
This project will use the offical NHL Hockey Data API.
I struggled to resolve an issue today with the "≠" versus the "!=" comparision operator. I fixed the issue by resolving the below listed errors and learned something new about Go. Links below:
-
NHL API - Credit to EQuimper
-
JSON to GO - Credit to mholt
Here is a photo of the converter that you should convert all of the data from the teams api from JSON to Go in:
- Get NHL API working locally with main.go
- Figure out how to lint in go with Git Hub Actions
- Select an Open Source security provider and integrate with Git Hub Actions
Here were some of the errors I recieved from the Comparison Operators
Sharing my current errors running a local git super lint tool locally which today I plan to write a custom git hub action for. The rest of day 2 will be fixing these errors and completing the second git hub action (Sharing learning experience)
- Installed 2 new workflows.
- Was able to get the basic application to run.
- Updated Documentation.
- Accepted first pull request for markup in the read.md from a community member.
- Setup a way to provision infrastructure as code (IaC) with a budget constrant
- Plan a way to recieve the data from the Restful API with something that has a GO SDK
- Plan, apply and test the code on local stack.
Photo of a correctly provisioned terraform package (opinionated):
Local Stack allows you to test Infrastructure of Code (IaC) with no cost.
- [Local Stack] https://localstack.cloud/
Acievments of the Day
- Provisioned 2 Terraform modules one remote and one local Resources: (AWS S3) (VPC) (API Gateway) (Lambda).
- Confirmed functionality of terraform with local stack.
- Configured GO Lint test to do a static scan and failed; created the projects first issue and will address on day 4.
- Configured Git Hub action to check for stale pull request to be inclusive of others helping.
After being able to fetch the API's today the focus was on Goroutines, ensuring the lint test passed and the program was written correctly before moving on to more advanced features.
I was able to follow the Go Documentation for time and fix the time.Since versus time.Now issue and pass the lint git hub action.
Next I wanted to do some time tests for the API call which hit about 56 K API requests in around 913 Mila-seconds. This is a huge advantage to GO instead of doing one at a time I was able to do them all at once.
Here is an image of what is should look like when you run the program locally. You can try it out with
go run goexample.go
As you can see all four badges are green now. I am going to call it for Day 4 and focus on security on Day 5 before diving into more advanced features.
I added Snyk today, best choice yet! Snyk IaC, and Snyk Open Source — uses Snyk’s GitHub actions to integrate Snyk natively with GitHub Security Code Scanning.
The level of detail it provides and the seamless workflow was amazing! Check out a vulnerability I generated to test the Infrastructure as Code portion with Terraform.
If you want to add Snyk to your workflow here are the steps:
- Visit the Snyk free tier site & setup an account
- Link it with your Git Hub
- Get the access key from the "settings tab"
- Select the language from the Snyk documenation
- Go to settings in Git Hub and setup a secret (I selected HashiCorp Vault)
- Change the .yml to your desired specs
- Setup and run your new workflow and select add badge if you desire to show your results
- Enhance security of the project; integrated Snyk
- Added documentation for issues and contributers to include the Code of Conduct
- Studied the use of Goroutines in the project and in the Go Playground
I deployed HCP Consul, and learned the basics of HashiCorp Cloud Platform (HCP) Consul and learned how to manually deploy a cluster and peer the HashiCorp Virtual Network (HVN) with your AWS Virtual Private Cloud (VPC).
Once I understood the basic components and steps required to deploy a Consul cluster, I automated the approach using HashiCorp Terraform.
I created an issue for the rest of the insfrstructure here is the link to Issue 30:
I want to use a 3 tier application with a focus on workflows for continous improvment. I want it to get data and offer the data based on queries from the user.
I found a model below and I am going to use it and adapt it to my use case for this project.
Today I am trying to learn to write data to the Postgres SQL database I am using for the project. Exploring the best place to learn.
I had some issues getting Postgres working locally and testing it's security upfront. I was able to solve this by using Nomad.
For now I just commited the nomad job as I am doing local testing for free. Once I can find more time I plan to commit my local test files.
- Update architecture with Nomad soltion
- Fix docs for how I was able to provison the test
- Start integrating the go module for scans
I was able to test and improve the AWS module with HashiStack installed. Working on integration of Go Module found some vulnerabilities trying to resolve.
I am falling in love with Go! I need your help and support to survie the next 93 days
As you can see I do not have much experience with Go yet! My goal is to have Go be at the top of this list by the end of this project.
I took a long break, that really was not a break and have been busy and not had time to work on this project... But I am back and ready to learn!