1
0
Fork 0
go packages which are fine
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.
 
 
Brian Picciano c20f884d68 mredis: fix how Block was being used, it wasn't being converted to an int properly 5 years ago
cmd/totp-proxy add root Dockerfile which will build all binaries 5 years ago
jstream mtest->mrand: move rand functionality from mtest into its own package 6 years ago
m m: fix tests after having modified initializing logging 5 years ago
mcfg mcfg: implement ParamDefaultOrRequired 5 years ago
mcmp mcmp: implement SeriesGetElement 5 years ago
mcrypto merr: refactor Wrap/WrapSkip/New to take multiple contexts rather than annotations 5 years ago
mctx mctx: refactor to no longer have parent/child logic 5 years ago
mdb mredis: fix how Block was being used, it wasn't being converted to an int properly 5 years ago
merr mtest/massert: rename a bunch of functions 5 years ago
mhttp mhttp: refactor to use Components 5 years ago
mlog mlog: clean up component code and add tests for it 5 years ago
mnet mnet: fix error handling during listen, to prevent a panic when a socket is taken 5 years ago
mrand mrand: implement NewSyncRand and use that for DefaultRand, to make it thread-safe 5 years ago
mrpc mtest->mrand: move rand functionality from mtest into its own package 6 years ago
mrun mrun: use mcmp.SeriesGetElement to iterate through hooks, so that hooks which get added while the iteration is happening (e.g. from CLISubCommand) can still get hit 5 years ago
mtest mnet: refactor to use Components 5 years ago
mtime mtime: fix older package doc not having been deleted 6 years ago
.dockerignore add root Dockerfile which will build all binaries 5 years ago
Dockerfile add root Dockerfile which will build all binaries 5 years ago
LICENSE Initial commit 6 years ago
README.md refactor everything to use context's annotation system, making some significant changes to annotations themselves along the way 5 years ago
TODO refactor everything to use context's annotation system, making some significant changes to annotations themselves along the way 5 years ago
env.test mredis: initial implementation 5 years ago
go.mod mredis: implement Stream helper type 5 years ago
go.sum mredis: implement Stream helper type 5 years ago

README.md

mediocre-go-lib

This is a collection of packages which I use across many of my personal projects. All packages intended to be used start with an m, packages not starting with m are for internal use within this set of packages.

Usage notes

  • In general, all checking of equality of errors, e.g. err == io.EOF, done on errors returned from the packages in this project should be done using merr.Equal, e.g. merr.Equal(err, io.EOF). The merr package is used to wrap errors and embed further metadata in them, like stack traces and so forth.

Styleguide

Here are general guidelines I use when making decisions about how code in this repo should be written. Most of the guidelines I have come up with myself have to do with package design, since packages are the only thing which have any rigidity and therefore need any rigid rules.

Everything here are guidelines, not actual rules.

  • gofmt -s

  • https://golang.org/doc/effective_go.html

  • https://github.com/golang/go/wiki/CodeReviewComments

  • Package names may be abbreviations of a concept, but types, functions, and methods should all be full words.

  • When deciding if a package should initialize a struct as a value or pointer, a good rule is: If it's used as an immutable value it should be a value, otherwise it's a pointer. Even if the immutable value implementation has internal caching, locks, etc..., that can be hidden as pointers inside the struct, but the struct itself can remain a value type.

  • A function which takes in a context.Context and returns a modified copy of that same context.Context should have a name prefixed with With, e.g. WithValue or WithLogger. Exceptions like Annotate do exist.