Go to file
kayos@tcp.direct 677c373f67
welcome to gotown, gophertard
2022-08-20 20:39:53 -07:00
cmd/fucktown welcome to gotown, gophertard 2022-08-20 20:39:53 -07:00
common welcome to gotown, gophertard 2022-08-20 20:39:53 -07:00
README.md welcome to gotown, gophertard 2022-08-20 20:39:53 -07:00
go.mod welcome to gotown, gophertard 2022-08-20 20:39:53 -07:00
go.sum welcome to gotown, gophertard 2022-08-20 20:39:53 -07:00

/home/e/Projects/fucktown

  • go mod init fucktown

  • mkdir common

  • mkdir -p cmd/fucktown

/home/e/Projects/fucktown/common/common.go


package common

func thisCanNotBeUsedInOtherPackages() string {
	return "yeet"
}

// ThisCan is an exported function. This comment will automatically
// generate documentation because it has the name of the function in the
// beginning.
func ThisCan() string {
	return thisCanNotBeUsedInOtherPackages()
}

/home/e/Projects/fucktown/cmd/fucktown/main.go


package main

import (
	"fucktown/common"
	"github.com/common-nighthawk/go-figure"
)

func main() {
	crappyFigletClone := figure.NewFigure(common.ThisCan(), "", true)
	crappyFigletClone.Print()
}

  • go mod tidy -v

  • cd cmd/fucktown

  • go run ./

╭─ ⸸kayos⸸  fhjones fucktown 
╰ go run ./
                        _
  _   _    ___    ___  | |_
 | | | |  / _ \  / _ \ | __|
 | |_| | |  __/ |  __/ | |_
  \__, |  \___|  \___|  \__|
  |___/

final tree

├── [4.0K]  cmd
│   └── [4.0K]  fucktown
│       ├── [ 196]  main.go
│       └── [ 818]  README.md
├── [4.0K]  common
│   └── [ 305]  common.go
├── [ 107]  go.mod
└── [ 249]  go.sum

3 directories, 5 files

auto go doc example as described in common.go

╭─ ⸸kayos⸸  fhjones common 
╰ pwd
/home/kayos/Workshop/fucktown/common

╭─ ⸸kayos⸸  fhjones common 
╰ go doc -all .
package common // import "fucktown/common"


FUNCTIONS

func ThisCan() string
    ThisCan is an exported function. This comment will automatically generate
    documentation because it has the name of the function in the beginning.

Other Notes

  • go vet ./...
    • use this to check syntactic validity of the entire project