diff --git a/.travis.yml b/.travis.yml index cebe937..41e2d06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,5 +19,5 @@ before_script: script: - diff -au <(gofmt -d .) <(printf "") - diff -au <(go vet .) <(printf "") - - go test - - go test -sio.BufSize=23 -sio.PlaintextSize=1825 + - go test ./... + - go test -sio.BufSize=23 -sio.PlaintextSize=1825 ./... diff --git a/sioutil/sio.go b/sioutil/sio.go new file mode 100644 index 0000000..a9441a1 --- /dev/null +++ b/sioutil/sio.go @@ -0,0 +1,22 @@ +// Copyright (c) 2019 Andreas Auernhammer. All rights reserved. +// Use of this source code is governed by a license that can be +// found in the LICENSE file. + +// Package sioutil implements some I/O utility functions. +package sioutil + +import ( + "io" +) + +type nopCloser struct { + io.Writer +} + +func (nopCloser) Close() error { return nil } + +// NopCloser returns a WriteCloser with a no-op Close method +// wrapping the provided Writer w. +func NopCloser(w io.Writer) io.WriteCloser { + return nopCloser{w} +}