Skip to content

Commit

Permalink
Remove 1.13 error handling
Browse files Browse the repository at this point in the history
Also added go.mod file
  • Loading branch information
bbrks committed May 9, 2019
1 parent 244e235 commit 46cfbe7
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 24 deletions.
5 changes: 1 addition & 4 deletions base83/error.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// +build !go1.13

package base83

import "errors"

// ErrInvalidInput is returned when the given input to decode is not valid base83.
var ErrInvalidInput = errors.New("base83: invalid input")
var ErrInvalidLength = errors.New("base83: invalid length")

// invalidError returns ErrInvalidInput for the given rune and index
func invalidError(r rune, i int) error {
// No stdlib support for wrapped errors, so return as-is pre-1.13
return ErrInvalidInput
Expand Down
9 changes: 0 additions & 9 deletions base83/error_go1.13.go

This file was deleted.

1 change: 1 addition & 0 deletions decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func Components(hash string) (x, y int, err error) {
return x, y, nil
}

// Decode returns an image of the given hash with the given size.
func Decode(hash string, width, height int, punch int) (img image.Image, err error) {
numX, numY, err := Components(hash)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions error.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build !go1.13

package blurhash

import "errors"
Expand Down
9 changes: 0 additions & 9 deletions error_go1.13.go

This file was deleted.

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/bbrks/go-blurhash

go 1.12

require github.com/matryer/is v1.2.0
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=

0 comments on commit 46cfbe7

Please sign in to comment.