Golang includes the go mod
command to initialize a new project. Sometimes that command fails even though it tries to be smart about where to get the name of your module from so we give an example of how to explicitly set the name of your go modules based project.
mkdir my-go-project
cd my-go-project
go mod init github.com/christopherbiscardi/my-go-project
Instructor: [00:00] To initialize a new golang project with Go modules, first we'll create a new directory for our new project.
[00:10] Now that we're in our new project directory, we can run go mod init. Go mod init tries to be smart about how it creates your new Go modules project. You can see here that we are outside our GOPATH and we don't have any import comments in our project, because we don't even have any Go files yet.
[00:29] To tell Go modules what the name of our module is, we use go mod init, with the fully qualified path to our module. We can see that go mod has now succeeded. Also note that we have a new file, called go.mod, that includes our module and the Go version we used. When we add imports to our Go code later, they'll also be added to this file.
What shell extension are you using to get the nice filename and line numbers on your cat
command?
What shell extension are you using to get the nice filename and line numbers on your
cat
command?
It's a tool called bat that replaces cat: https://github.com/sharkdp/bat
I have alias cat=bat
in my shell profile so whenever I type cat
its using bat
.
It's a tool called bat that replaces cat: https://github.com/sharkdp/bat
Fantastic, thanks Chris.
I don't like go :/ If typescript compiled, go would be totally superfluous.