GoLib

module
v0.0.0-...-bea3eb9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2025 License: MIT

README

GoLib

Go Library code, generally reusable bits

TEST

go test -count=1 cache_test.go cache.go cacheitem.go ^^ the -count=1 bypasses the test execution cache to force the tests to run each time.

View the test coverage report like so: go tool cover -html=.test_coverage.txt

TODO

  • Documentation/README, SDK site
  • Examples
  • Standardized error handling; use fmt.Errorf("%d", num) instead of errors.New(fmt.Sprintf("%d", num))

REFACTORING:

  • Accept Interfaces, return structs (except by exception)
  • Use pointer receiver for mutable (write) operations, copy for immutable (read) operations
  • Use mutex lock, semaphore, channels, etc for mutable (write) operations (prefer go-routine+channel for concurrency orchestration, over mutex)
  • Use r for receiver everywhere for better copy/paste; only use (*r) when necessary (actually 'this' might have been syntactically nice...)
  • Clean up TODO's / FIXME's as reasonably able
  • Add test overage as reasonably able
  • Add documentation (godoc, readme) as reasonably able
  • Add working examples as reasonably able
  • Use fmt.Errorf() instead of errors.New()
  • Don't produce error log output from library functions where it can be left to the consumer
  • ONE exported struct+interface per source file will make the code easier to read (with exceptions)
  • Log Trace() messages to track entry into library functions with calling arguments as appropriate
  • Implement io.Closer interface for any class that opens/managers precious and/or external resources which should be closed/freed upon release/shutdown, etc.
  • Handle r == nil receivers

Directories

Path Synopsis
Auth
DigiStratum GoLib - Cache
DigiStratum GoLib - Cache
Cloud
aws
DigiStratum GoLib - Config
DigiStratum GoLib - Config
Crypto
DB
MySQL/example command
bytemap
DigiStratum GoLib - ByteMap
DigiStratum GoLib - ByteMap
hashmap
DigiStratum GoLib - HashMap
DigiStratum GoLib - HashMap
json
DigiStratum GoLib - JSON
DigiStratum GoLib - JSON
transcoder
DigiStratum GoLib - Transcoder for plain text content
DigiStratum GoLib - Transcoder for plain text content
DigiStratum GoLib - Dependency Injection
DigiStratum GoLib - Dependency Injection
example command
DigiStratum GoLib - Logger
DigiStratum GoLib - Logger
Net
example command
TestRunner
filepath: /Users/skelly/Documents/GoProjects/GoLib/TestRunner/packagerunner.go
filepath: /Users/skelly/Documents/GoProjects/GoLib/TestRunner/packagerunner.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL