Skip to content

Commit

Permalink
Merge pull request #1 from zemanlx/develop
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
zemanlx authored Jun 26, 2019
2 parents e5386c2 + 8414682 commit d8edb87
Show file tree
Hide file tree
Showing 41 changed files with 16,900 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage.txt
build
dist
57 changes: 57 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
# you may remove this if you don't use vgo
- go mod download
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0

# GOOS list to build for.
# For more info refer to: https://golang.org/doc/install/source#environment
# Defaults are darwin and linux.
goos:
- darwin
- drogonfly
- freebsd
- linux
- netbsd
- openbsd
- plan9
- solaris
- windows

# GOARCH to build for.
# For more info refer to: https://golang.org/doc/install/source#environment
# Defaults are 386 and amd64.
goarch:
- 386
- amd64
- arm
- arm64
- mips
- mipsle
- mips64
- mips64le
- s390x
- ppc64

archives:
- builds:
- default
format: binary
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
release:
draft: true
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .travis.yml
language: go

go:
- 1.12.x

env:
- GO111MODULE=on

script:
- make test
- make integration-test

# calls goreleaser
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Vlastimil Zeman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
SHELL := /bin/bash

.DEFAULT_GOAL: build

# These will be provided to the target
VERSION := $(shell git describe --tags 2>/dev/null || echo "0.0.0")
COMMIT := $(shell git rev-parse --short=8 HEAD)

# Use linker flags to provide version/build settings to the target
LDFLAGS=-ldflags "-s -w -X=main.version=$(VERSION) -X=main.commit=$(COMMIT)"

.PHONY: build
build:
@env GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o build/base64.linux.amd64

.PHONY: clean
clean:
@rm -f $(TARGET)

.PHONY: install
install:
@go install $(LDFLAGS)

.PHONY: lint
lint:
@golangci-lint --color always run

.PHONY: simplify
simplify:
@gofmt -s -l -w .

.PHONY: test
test:
@go test -race -coverprofile=coverage.txt -covermode=atomic ./...

.PHONY: fuzz-xbase
fuzz-xbase:
@go-fuzz -bin=xbase/xbase-fuzz.zip -workdir=xbase/fuzz
@(cd xbase && go-fuzz-build github.com/zemanlx/base64/xbase)

.PHONY: integration-test
integration-test: build
@./integration_test.sh
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
[![Build Status](https://travis-ci.org/zemanlx/base64.svg?branch=develop)](https://travis-ci.org/zemanlx/base64)
[![Go Report Card](https://goreportcard.com/badge/github.com/zemanlx/base64)](https://goreportcard.com/report/github.com/zemanlx/base64)
[![GuardRails badge](https://badges.guardrails.io/zemanlx/base64.svg?token=211ba559a3ab43c3e7c227365d0c757ca0dce0b474d048fcf0366967c2ef8b7f)](https://dashboard.guardrails.io/default/gh/zemanlx/base64)

# base64

Backward compatible alternative of Linux `base64`.
Backward compatible alternative of Linux `base64` plus

- URL encoding option
- No padding option (both for standard and URL encoding)

```man
Usage: base64 [OPTION]... [FILE]
Base64 encode or decode FILE, or standard input, to standard output.
With no FILE, or when FILE is -, read standard input.
-d, --decode decode data
-h, --help print this help
-i, --ignore-garbage when decoding, ignore non-alphabet characters
-n, --no-padding omit padding
-u, --url use URL encoding according RFC4648
-v, --version output version information and exit
-w, --wrap uint wrap encoded lines after COLS character,
use 0 to disable line wrapping (default 76)
The data are encoded as described for the base64 alphabet in RFC 4648.
When decoding, the input may contain newlines in addition to the bytes of
the formal base64 alphabet. Use --ignore-garbage to attempt to recover
from any other non-alphabet bytes in the encoded stream.
```
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/zemanlx/base64

go 1.12

require github.com/spf13/pflag v1.0.3
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
Loading

0 comments on commit d8edb87

Please sign in to comment.