Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

Missing dependency: github.com/karrick/[email protected] fixes #243 #244

Merged
merged 1 commit into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions v2/file/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
)

type info struct {
Path string
Contents []byte
size int64
modTime time.Time
isDir bool
Path string
Contents []byte
size int64
modTime time.Time
isDir bool
}

func (f info) Name() string {
Expand Down
2 changes: 1 addition & 1 deletion v2/file/resolver/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"sync"

"github.com/gobuffalo/packr/v2/file"
"github.com/gobuffalo/packr/v2/internal/takeon/github.com/karrick/godirwalk"
"github.com/gobuffalo/packr/v2/plog"
"github.com/karrick/godirwalk"
)

var _ Resolver = &Disk{}
Expand Down
36 changes: 18 additions & 18 deletions v2/file/resolver/encoding/hex/hex.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const hextable = "0123456789abcdef"

// EncodedLen returns the length of an encoding of n source bytes.
// Specifically, it returns n * 2.
func EncodedLen(n int) int { return n * 2 }
func EncodedLen(n int) int { return n * 2 }

// Encode encodes src into EncodedLen(len(src))
// bytes of dst. As a convenience, it returns the number
Expand Down Expand Up @@ -44,7 +44,7 @@ func (e InvalidByteError) Error() string {

// DecodedLen returns the length of a decoding of x source bytes.
// Specifically, it returns x / 2.
func DecodedLen(x int) int { return x / 2 }
func DecodedLen(x int) int { return x / 2 }

// Decode decodes src into DecodedLen(len(src)) bytes,
// returning the actual number of bytes written to dst.
Expand Down Expand Up @@ -126,9 +126,9 @@ func Dump(data []byte) string {
const bufferSize = 1024

type encoder struct {
w io.Writer
err error
out [bufferSize]byte // output buffer
w io.Writer
err error
out [bufferSize]byte // output buffer
}

// NewEncoder returns an io.Writer that writes lowercase hexadecimal characters to w.
Expand All @@ -153,10 +153,10 @@ func (e *encoder) Write(p []byte) (n int, err error) {
}

type decoder struct {
r io.Reader
err error
in []byte // input buffer (encoded form)
arr [bufferSize]byte // backing array for in
r io.Reader
err error
in []byte // input buffer (encoded form)
arr [bufferSize]byte // backing array for in
}

// NewDecoder returns an io.Reader that decodes hexadecimal characters from r.
Expand All @@ -169,7 +169,7 @@ func (d *decoder) Read(p []byte) (n int, err error) {
// Fill internal buffer with sufficient bytes to decode
if len(d.in) < 2 && d.err == nil {
var numCopy, numRead int
numCopy = copy(d.arr[:], d.in) // Copies either 0 or 1 bytes
numCopy = copy(d.arr[:], d.in) // Copies either 0 or 1 bytes
numRead, d.err = d.r.Read(d.arr[numCopy:])
d.in = d.arr[:numCopy+numRead]
if d.err == io.EOF && len(d.in)%2 != 0 {
Expand All @@ -188,11 +188,11 @@ func (d *decoder) Read(p []byte) (n int, err error) {
numDec, err := Decode(p, d.in[:len(p)*2])
d.in = d.in[2*numDec:]
if err != nil {
d.in, d.err = nil, err // Decode error; discard input remainder
d.in, d.err = nil, err // Decode error; discard input remainder
}

if len(d.in) < 2 {
return numDec, d.err // Only expose errors when buffer fully consumed
return numDec, d.err // Only expose errors when buffer fully consumed
}
return numDec, nil
}
Expand All @@ -205,12 +205,12 @@ func Dumper(w io.Writer) io.WriteCloser {
}

type dumper struct {
w io.Writer
rightChars [18]byte
buf [14]byte
used int // number of bytes in the current line
n uint // number of bytes, total
closed bool
w io.Writer
rightChars [18]byte
buf [14]byte
used int // number of bytes in the current line
n uint // number of bytes, total
closed bool
}

func toChar(b byte) byte {
Expand Down
12 changes: 6 additions & 6 deletions v2/file/resolver/hex_gzip.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
var _ Resolver = &HexGzip{}

type HexGzip struct {
packed map[string]string
unpacked map[string]string
moot *sync.RWMutex
packed map[string]string
unpacked map[string]string
moot *sync.RWMutex
}

func (hg HexGzip) String() string {
Expand Down Expand Up @@ -77,9 +77,9 @@ func NewHexGzip(files map[string]string) (*HexGzip, error) {
}

hg := &HexGzip{
packed: files,
unpacked: map[string]string{},
moot: &sync.RWMutex{},
packed: files,
unpacked: map[string]string{},
moot: &sync.RWMutex{},
}

return hg, nil
Expand Down
8 changes: 4 additions & 4 deletions v2/file/resolver/ident_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

func Test_Ident_OsPath(t *testing.T) {
table := map[string]string{
"foo/bar/baz": "foo/bar/baz",
"foo\\bar\\baz": "foo/bar/baz",
"foo/bar/baz": "foo/bar/baz",
"foo\\bar\\baz": "foo/bar/baz",
}

if runtime.GOOS == "windows" {
Expand All @@ -27,7 +27,7 @@ func Test_Ident_OsPath(t *testing.T) {

func ident_OsPath_Windows_Table() map[string]string {
return map[string]string{
"foo/bar/baz": "foo\\bar\\baz",
"foo\\bar\\baz": "foo\\bar\\baz",
"foo/bar/baz": "foo\\bar\\baz",
"foo\\bar\\baz": "foo\\bar\\baz",
}
}
3 changes: 1 addition & 2 deletions v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ require (
github.com/gobuffalo/envy v1.7.1
github.com/gobuffalo/logger v1.0.1
github.com/gobuffalo/packd v0.3.0
github.com/karrick/godirwalk v1.11.3
github.com/rogpeppe/go-internal v1.4.0
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.4.0
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
golang.org/x/tools v0.0.0-20190930152728-90aeebe84374
golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3
)
7 changes: 2 additions & 5 deletions v2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/karrick/godirwalk v1.11.3 h1:ZrtYOzzHRzItdU1MvkK3CLlhC4m3YTWFgGyiBuSCQSY=
github.com/karrick/godirwalk v1.11.3/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
Expand Down Expand Up @@ -65,7 +63,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 h1:ydJNl0ENAG67pFbB+9tfhiL2pYqLhfoaZFw/cjLhY4A=
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
Expand All @@ -77,8 +74,8 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190515120540-06a5c4944438 h1:khxRGsvPk4n2y8I/mLLjp7e5dMTJmH75wvqS6nMwUtY=
golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190930152728-90aeebe84374 h1:gtmDBXipY3qmHzbMZV3Y7rPqd9/Y+p7kvA6JxRsBQO0=
golang.org/x/tools v0.0.0-20190930152728-90aeebe84374/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3 h1:2AmBLzhAfXj+2HCW09VCkJtHIYgHTIPcTeYqgP7Bwt0=
golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
Expand Down
10 changes: 5 additions & 5 deletions v2/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (

func construct(name string, path string) *Box {
return &Box{
Path: path,
Name: name,
ResolutionDir: resolutionDir(path),
resolvers: resolversMap{},
dirs: dirsMap{},
Path: path,
Name: name,
ResolutionDir: resolutionDir(path),
resolvers: resolversMap{},
dirs: dirsMap{},
}
}

Expand Down
25 changes: 25 additions & 0 deletions v2/internal/takeon/github.com/karrick/godirwalk/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2017, Karrick McDermott
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading