News for hackers. Stuff that matters.
Re:Learn Go: Hand-crafted Go exercises and examples by triztian on Sunday May 17, 2020 @03:06AM (#23210213)
Hey there I found modules to be confusing coming from GOPATH too, but they're straight forward, super barebones example:

    #!/bin/bash

    cd $HOME

    # Create project directory
    mkdir hellogo

    cd hellogo

    # Init project modfile
    go mod init example.com/hellogo

    # Create the main source file
    # Uses bash's heredoc
    cat << EOF > ./main.go
    package main
    import "fmt"
    func main() {
        fmt.Print("Hello world")
    }
    EOF

    # Build it
    go build

    # Run it
    ./hellogo
Re:Learn Go: Hand-crafted Go exercises and examples by sk0g on Sunday May 17, 2020 @05:16AM (#23210752)
You can also skip building, and run directly using `go run`!