add platformtest: infrastructure for ZFS compatiblity testing

This commit is contained in:
Christian Schwarz
2019-08-20 17:04:13 +02:00
parent 07956c2299
commit a6497b2c6e
15 changed files with 689 additions and 3 deletions
+24
View File
@@ -0,0 +1,24 @@
package platformtest
import (
"context"
"github.com/zrepl/zrepl/logger"
)
type Logger = logger.Logger
type contextKey int
const (
contextKeyLogger contextKey = iota
)
func WithLogger(ctx context.Context, logger Logger) context.Context {
ctx = context.WithValue(ctx, contextKeyLogger, logger)
return ctx
}
func getLog(ctx context.Context) Logger {
return ctx.Value(contextKeyLogger).(Logger)
}