1
0
Fork 0
mirror of https://github.com/on4kjm/FLEcli.git synced 2025-01-31 23:01:04 +01:00
FLEcli/notes/enableGo.md

45 lines
1.5 KiB
Markdown
Raw Normal View History

2020-05-27 08:26:31 +02:00
# Enable GO
Notes to enable/configure GO on my Mac
```
# GOlang related
export GOPATH="${HOME}/.go"
export GOROOT="$(brew --prefix golang)/libexec"
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
test -d "${GOPATH}" || mkdir "${GOPATH}"
test -d "${GOPATH}/src/github.com" || mkdir -p "${GOPATH}/src/github.com"
2020-05-27 21:29:23 +02:00
```
* Use Brew to instal Go
* Load the various tools in in VisualCode
2020-05-27 22:29:59 +02:00
* `go mod init example.com/user/hello`
* Structuring a go project: https://github.com/golang-standards/project-layout
## Enable cobra
2020-05-28 13:32:34 +02:00
Cobra documentation available at https://github.com/spf13/cobra/blob/master/cobra/README.md
2020-05-27 22:29:59 +02:00
* `go get -u github.com/spf13/cobra/cobra`
* `go mod init FLEcli`
2020-05-28 13:32:34 +02:00
* `cobra init --pkg-name FLEcli -l MIT`
2020-05-28 13:52:20 +02:00
* `cobra add load` adds a load command
## Reading and processing file
* [Go by Example: Reading Files](https://gobyexample.com/reading-files)
* https://stackoverflow.com/questions/8757389/reading-a-file-line-by-line-in-go
2020-05-28 22:50:40 +02:00
* https://www.golangprograms.com/golang-read-file-line-by-line-to-string.html
2020-05-30 17:25:33 +02:00
## Regex
* useful site: https://regex101.com
* [Regex to verify Hamradio callsign and retrieve prefix](https://regex101.com/library/6QhGuD)
* [Hamradio callsign](https://regex101.com/library/uP6xD2)
2020-05-30 17:47:41 +02:00
* [Verify amateur radio call sign meets ITU format](https://regex101.com/library/gS6qG8)
## Parsing 2
* [Effective text parsing in golang](https://medium.com/@TobiasSchmidt89/effective-text-parsing-in-golang-163d13784288)
2020-05-30 20:13:25 +02:00
2020-06-02 08:16:04 +02:00
## Amateur related Golang libray
* https://github.com/tzneal/ham-go