-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker autobuild and fix codestyle (#1)
* add autobuilding for a docker image * fix codestyle * update shields
- Loading branch information
Showing
7 changed files
with
44 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
language: go | ||
|
||
go: | ||
- 1.9.x | ||
- tip | ||
|
||
script: | ||
- go test -v -race ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
FROM alpine:3.6 | ||
|
||
MAINTAINER [email protected] | ||
# builder layer | ||
FROM golang:1.9-alpine as builder | ||
COPY . /go/src/github.com/xjewer/snitch | ||
RUN go build -o /snitch github.com/xjewer/snitch/cmd/snitch | ||
|
||
# original image | ||
FROM alpine:3.6 | ||
LABEL maintainer="[email protected]" | ||
RUN apk --update add ca-certificates | ||
COPY snitch / | ||
|
||
COPY --from=builder /snitch . | ||
ENTRYPOINT ["/snitch"] | ||
CMD ["--help"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
package simplelog | ||
|
||
// Logger interface, log.Logger satisfy this interface | ||
type Logger interface { | ||
Println(...interface{}) | ||
Print(...interface{}) | ||
Printf(string, ...interface{}) | ||
} | ||
|
||
type NoopLogger struct {} | ||
// NoopLogger is a no-op Logger implementation | ||
type NoopLogger struct{} | ||
|
||
// Println is a no-op Println implementation | ||
func (n *NoopLogger) Println(...interface{}) {} | ||
|
||
// Print is a no-op Print implementation | ||
func (n *NoopLogger) Print(...interface{}) {} | ||
|
||
// Printf is a no-op Printf implementation | ||
func (n *NoopLogger) Printf(string, ...interface{}) {} |