Vikrant Payal

Common issues


Golang

go get not working,

Problem:
You are trying to install a go package, ex. gorilla mux, using go get and you get the error:
go: go.mod file not found in current directory or any parent directory.
'go get' is no longer supported outside a module.
To build and install a command, use 'go install' with a version,

Solution:
Do - Initialize go.mod using go mode init example.com/m. Then run go get package-name
Don't - Try go install






AWS - DNS configuration

Configure namespace, DNS records and SSL in AWS when domain is registered on another service

Problem:
Domain registered on a DNS service outside AWS. Need to configure routing, SSL etc in AWS.
This is supposed to be simple and quick. It is on most cloud services like Linode. AWS makes the whole thing really complicated and introduces opportunities to step on your own foot or reach deadends. Here is my understanding of how to avoid a mess.

Use S3 to host the landing page (reference). Then, assuming you do not have any certificates and route 53 records, go in this sequence:
CloudFront > Certificate Manager > Route 53

At the end of this configuration, the website:
(1) Should route http://sitename.com to https://sitename.com
(2) https://sitename.com should open the index.html page
(3) http://www.sitename.com or www.sitename.com or https://www.sitename.com should all open https://sitename.com, that is the home page index.html