You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kayos@tcp.direct 677c373f67
welcome to gotown, gophertard
1 month ago
cmd/fucktown welcome to gotown, gophertard 1 month ago
common welcome to gotown, gophertard 1 month ago
README.md welcome to gotown, gophertard 1 month ago
go.mod welcome to gotown, gophertard 1 month ago
go.sum welcome to gotown, gophertard 1 month ago

README.md

/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