go packages which are fine
Go to file
2019-06-23 11:43:54 -06:00
cmd/totp-proxy add root Dockerfile which will build all binaries 2019-06-18 00:12:54 -04:00
jstream mtest->mrand: move rand functionality from mtest into its own package 2018-07-03 00:20:00 +00:00
m m: fix tests after having modified initializing logging 2019-06-23 11:43:54 -06:00
mcfg mcmp: make thread-safe, add InheritedValue, refactor Context/Annotation related methods 2019-06-17 16:51:25 -04:00
mcmp mcmp: make InheritedValue a function, not a method, and add Parent method to support it 2019-06-23 11:17:48 -06:00
mcrypto merr: refactor Wrap/WrapSkip/New to take multiple contexts rather than annotations 2019-02-27 13:05:51 -05:00
mctx mctx: refactor to no longer have parent/child logic 2019-06-15 17:28:29 -06:00
mdb mtest/massert: rename a bunch of functions 2019-03-10 19:23:37 -04:00
merr mtest/massert: rename a bunch of functions 2019-03-10 19:23:37 -04:00
mhttp mhttp: refactor to use Components 2019-06-17 17:14:00 -04:00
mlog mlog: clean up component code and add tests for it 2019-06-23 11:39:36 -06:00
mnet mnet: refactor to use Components 2019-06-17 17:13:49 -04:00
mrand mrand: fix bug in Hex with it not outputting correct number of characters for odd number inputs 2018-08-13 19:40:15 -04:00
mrpc mtest->mrand: move rand functionality from mtest into its own package 2018-07-03 00:20:00 +00:00
mrun mcmp: rename GetSeries* functions to just Series* 2019-06-15 17:52:55 -06:00
mtest mnet: refactor to use Components 2019-06-17 17:13:49 -04:00
mtime mtime: fix older package doc not having been deleted 2018-05-27 07:57:23 +00:00
.dockerignore add root Dockerfile which will build all binaries 2019-06-18 00:12:54 -04:00
Dockerfile add root Dockerfile which will build all binaries 2019-06-18 00:12:54 -04:00
env.test mtest/massert: rename a bunch of functions 2019-03-10 19:23:37 -04:00
go.mod mdb/msql: implement basic MySQL connector 2019-02-24 16:30:53 -05:00
go.sum mdb/msql: implement basic MySQL connector 2019-02-24 16:30:53 -05:00
LICENSE Initial commit 2018-01-11 15:47:01 +00:00
README.md refactor everything to use context's annotation system, making some significant changes to annotations themselves along the way 2019-02-24 15:36:07 -05:00
TODO refactor everything to use context's annotation system, making some significant changes to annotations themselves along the way 2019-02-24 15:36:07 -05:00

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.