diff --git a/v2/box.go b/v2/box.go index ab2a290..a2636de 100644 --- a/v2/box.go +++ b/v2/box.go @@ -15,8 +15,8 @@ import ( "github.com/gobuffalo/packd" "github.com/gobuffalo/packr/v2/file" "github.com/gobuffalo/packr/v2/file/resolver" - "github.com/gobuffalo/packr/v2/internal/takeon/github.com/markbates/oncer" "github.com/gobuffalo/packr/v2/plog" + "github.com/markbates/oncer" ) var _ packd.Box = &Box{} diff --git a/v2/deprecated.go b/v2/deprecated.go index 25f5b34..0da2201 100644 --- a/v2/deprecated.go +++ b/v2/deprecated.go @@ -6,7 +6,7 @@ import ( "github.com/gobuffalo/packr/v2/file" "github.com/gobuffalo/packr/v2/file/resolver" - "github.com/gobuffalo/packr/v2/internal/takeon/github.com/markbates/oncer" + "github.com/markbates/oncer" ) // File has been deprecated and file.File should be used instead diff --git a/v2/file/resolver/disk.go b/v2/file/resolver/disk.go index 52da9c1..8c3c1e7 100644 --- a/v2/file/resolver/disk.go +++ b/v2/file/resolver/disk.go @@ -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{} diff --git a/v2/go.mod b/v2/go.mod index 40bbf14..0defc4b 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -4,13 +4,15 @@ go 1.13 require ( github.com/gobuffalo/logger v1.0.3 - github.com/gobuffalo/packd v0.3.0 - github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect - github.com/rogpeppe/go-internal v1.4.0 + github.com/gobuffalo/packd v1.0.0 + github.com/karrick/godirwalk v1.15.3 + github.com/markbates/errx v1.1.0 + github.com/markbates/oncer v1.0.0 + github.com/markbates/safe v1.0.1 + github.com/rogpeppe/go-internal v1.5.2 github.com/sirupsen/logrus v1.4.2 - github.com/spf13/cobra v0.0.5 - github.com/stretchr/testify v1.4.0 + github.com/spf13/cobra v0.0.6 + github.com/stretchr/testify v1.5.1 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e - golang.org/x/sys v0.0.0-20190515120540-06a5c4944438 // indirect - golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3 + golang.org/x/tools v0.0.0-20200308013534-11ec41452d41 ) diff --git a/v2/go.sum b/v2/go.sum index 148436b..4be647f 100644 --- a/v2/go.sum +++ b/v2/go.sum @@ -1,78 +1,178 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobuffalo/logger v1.0.3 h1:YaXOTHNPCvkqqA7w05A4v0k2tCdpr+sgFlgINbQ6gqc= github.com/gobuffalo/logger v1.0.3/go.mod h1:SoeejUwldiS7ZsyCBphOGURmWdwUFXs0J7TCjEhjKxM= -github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4= -github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= +github.com/gobuffalo/packd v1.0.0 h1:6ERZvJHfe24rfFmA9OaoKBdC7+c9sydrytMg8SdFGBM= +github.com/gobuffalo/packd v1.0.0/go.mod h1:6VTc4htmJRFB7u1m/4LeMTWjFoYrUiBkU9Fdec9hrhI= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/karrick/godirwalk v1.15.3 h1:0a2pXOgtB16CqIqXTiT7+K9L73f74n/aNQUnH6Ortew= +github.com/karrick/godirwalk v1.15.3/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= 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= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/markbates/errx v1.1.0 h1:QDFeR+UP95dO12JgW+tgi2UVfo0V8YBHiUIOaeBPiEI= +github.com/markbates/errx v1.1.0/go.mod h1:PLa46Oex9KNbVDZhKel8v1OT7hD5JZ2eI7AHhA0wswc= +github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY= +github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= +github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.4.0 h1:LUa41nrWTQNGhzdsZ5lTnkwbNjj6rXTdazA1cSdjkOY= -github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.5.2 h1:qLvObTrvO/XRCqmkKxUlOBc48bI3efyDuAZe25QiF0w= +github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v0.0.6 h1:breEStsVwemnKh2/s6gMvSdMEkwW0sK8vGStnlVBMCs= +github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c h1:/nJuwDLoL/zrqY6gf57vxC+Pi+pZ8bfhpPkicO5H7W4= golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 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/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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-20191004055002-72853e10c5a3 h1:2AmBLzhAfXj+2HCW09VCkJtHIYgHTIPcTeYqgP7Bwt0= -golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200308013534-11ec41452d41 h1:9Di9iYgOt9ThCipBxChBVhgNipDoE5mxO84rQV7D0FE= +golang.org/x/tools v0.0.0-20200308013534-11ec41452d41/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 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= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/v2/internal/envy.go b/v2/internal/envy.go index 21ae401..30cf7b5 100644 --- a/v2/internal/envy.go +++ b/v2/internal/envy.go @@ -34,4 +34,4 @@ func GoPaths() []string { return strings.Split(gp, ";") // Windows uses a different separator } return strings.Split(gp, ":") -} \ No newline at end of file +} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/LICENSE b/v2/internal/takeon/github.com/karrick/godirwalk/LICENSE deleted file mode 100644 index 01ce194..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -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. diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/README.md b/v2/internal/takeon/github.com/karrick/godirwalk/README.md deleted file mode 100644 index e2ba74c..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/README.md +++ /dev/null @@ -1,215 +0,0 @@ -# godirwalk - -`godirwalk` is a library for traversing a directory tree on a file -system. - -[![GoDoc](https://godoc.org/github.com/karrick/godirwalk?status.svg)](https://godoc.org/github.com/karrick/godirwalk) [![Build Status](https://dev.azure.com/microsoft0235/microsoft/_apis/build/status/karrick.godirwalk?branchName=master)](https://dev.azure.com/microsoft0235/microsoft/_build/latest?definitionId=1&branchName=master) - -In short, why do I use this library? - -1. It's faster than `filepath.Walk`. -1. It's more correct on Windows than `filepath.Walk`. -1. It's more easy to use than `filepath.Walk`. -1. It's more flexible than `filepath.Walk`. - -## Usage Example - -Additional examples are provided in the `examples/` subdirectory. - -This library will normalize the provided top level directory name -based on the os-specific path separator by calling `filepath.Clean` on -its first argument. However it always provides the pathname created by -using the correct os-specific path separator when invoking the -provided callback function. - -```Go - dirname := "some/directory/root" - err := godirwalk.Walk(dirname, &godirwalk.Options{ - Callback: func(osPathname string, de *godirwalk.Dirent) error { - fmt.Printf("%s %s\n", de.ModeType(), osPathname) - return nil - }, - Unsorted: true, // (optional) set true for faster yet non-deterministic enumeration (see godoc) - }) -``` - -This library not only provides functions for traversing a file system -directory tree, but also for obtaining a list of immediate descendants -of a particular directory, typically much more quickly than using -`os.ReadDir` or `os.ReadDirnames`. - -## Description - -Here's why I use `godirwalk` in preference to `filepath.Walk`, -`os.ReadDir`, and `os.ReadDirnames`. - -### It's faster than `filepath.Walk` - -When compared against `filepath.Walk` in benchmarks, it has been -observed to run between five and ten times the speed on darwin, at -speeds comparable to the that of the unix `find` utility; about twice -the speed on linux; and about four times the speed on Windows. - -How does it obtain this performance boost? It does less work to give -you nearly the same output. This library calls the same `syscall` -functions to do the work, but it makes fewer calls, does not throw -away information that it might need, and creates less memory churn -along the way by reusing the same scratch buffer for reading from a -directory rather than reallocating a new buffer every time it reads -file system entry data from the operating system. - -While traversing a file system directory tree, `filepath.Walk` obtains -the list of immediate descendants of a directory, and throws away the -file system node type information provided by the operating system -that comes with the node's name. Then, immediately prior to invoking -the callback function, `filepath.Walk` invokes `os.Stat` for each -node, and passes the returned `os.FileInfo` information to the -callback. - -While the `os.FileInfo` information provided by `os.Stat` is extremely -helpful--and even includes the `os.FileMode` data--providing it -requires an additional system call for each node. - -Because most callbacks only care about what the node type is, this -library does not throw the type information away, but rather provides -that information to the callback function in the form of a -`os.FileMode` value. Note that the provided `os.FileMode` value that -this library provides only has the node type information, and does not -have the permission bits, sticky bits, or other information from the -file's mode. If the callback does care about a particular node's -entire `os.FileInfo` data structure, the callback can easiy invoke -`os.Stat` when needed, and only when needed. - -#### Benchmarks - -##### macOS - -```Bash -$ go test -bench=. -benchmem -goos: darwin -goarch: amd64 -pkg: github.com/karrick/godirwalk -BenchmarkReadDirnamesStandardLibrary-12 50000 26250 ns/op 10360 B/op 16 allocs/op -BenchmarkReadDirnamesThisLibrary-12 50000 24372 ns/op 5064 B/op 20 allocs/op -BenchmarkFilepathWalk-12 1 1099524875 ns/op 228415912 B/op 416952 allocs/op -BenchmarkGodirwalk-12 2 526754589 ns/op 103110464 B/op 451442 allocs/op -BenchmarkGodirwalkUnsorted-12 3 509219296 ns/op 100751400 B/op 378800 allocs/op -BenchmarkFlameGraphFilepathWalk-12 1 7478618820 ns/op 2284138176 B/op 4169453 allocs/op -BenchmarkFlameGraphGodirwalk-12 1 4977264058 ns/op 1031105328 B/op 4514423 allocs/op -PASS -ok github.com/karrick/godirwalk 21.219s -``` - -##### Linux - -```Bash -$ go test -bench=. -benchmem -goos: linux -goarch: amd64 -pkg: github.com/karrick/godirwalk -BenchmarkReadDirnamesStandardLibrary-12 100000 15458 ns/op 10360 B/op 16 allocs/op -BenchmarkReadDirnamesThisLibrary-12 100000 14646 ns/op 5064 B/op 20 allocs/op -BenchmarkFilepathWalk-12 2 631034745 ns/op 228210216 B/op 416939 allocs/op -BenchmarkGodirwalk-12 3 358714883 ns/op 102988664 B/op 451437 allocs/op -BenchmarkGodirwalkUnsorted-12 3 355363915 ns/op 100629234 B/op 378796 allocs/op -BenchmarkFlameGraphFilepathWalk-12 1 6086913991 ns/op 2282104720 B/op 4169417 allocs/op -BenchmarkFlameGraphGodirwalk-12 1 3456398824 ns/op 1029886400 B/op 4514373 allocs/op -PASS -ok github.com/karrick/godirwalk 19.179s -``` - -### It's more correct on Windows than `filepath.Walk` - -I did not previously care about this either, but humor me. We all love -how we can write once and run everywhere. It is essential for the -language's adoption, growth, and success, that the software we create -can run unmodified on all architectures and operating systems -supported by Go. - -When the traversed file system has a logical loop caused by symbolic -links to directories, on unix `filepath.Walk` ignores symbolic links -and traverses the entire directory tree without error. On Windows -however, `filepath.Walk` will continue following directory symbolic -links, even though it is not supposed to, eventually causing -`filepath.Walk` to terminate early and return an error when the -pathname gets too long from concatenating endless loops of symbolic -links onto the pathname. This error comes from Windows, passes through -`filepath.Walk`, and to the upstream client running `filepath.Walk`. - -The takeaway is that behavior is different based on which platform -`filepath.Walk` is running. While this is clearly not intentional, -until it is fixed in the standard library, it presents a compatibility -problem. - -This library correctly identifies symbolic links that point to -directories and will only follow them when `FollowSymbolicLinks` is -set to true. Behavior on Windows and other operating systems is -identical. - -### It's more easy to use than `filepath.Walk` - -Since this library does not invoke `os.Stat` on every file system node -it encounters, there is no possible error event for the callback -function to filter on. The third argument in the `filepath.WalkFunc` -function signature to pass the error from `os.Stat` to the callback -function is no longer necessary, and thus eliminated from signature of -the callback function from this library. - -Also, `filepath.Walk` invokes the callback function with a solidus -delimited pathname regardless of the os-specific path separator. This -library invokes the callback function with the os-specific pathname -separator, obviating a call to `filepath.Clean` in the callback -function for each node prior to actually using the provided pathname. - -In other words, even on Windows, `filepath.Walk` will invoke the -callback with `some/path/to/foo.txt`, requiring well written clients -to perform pathname normalization for every file prior to working with -the specified file. In truth, many clients developed on unix and not -tested on Windows neglect this subtlety, and will result in software -bugs when running on Windows. This library would invoke the callback -function with `some\path\to\foo.txt` for the same file when running on -Windows, eliminating the need to normalize the pathname by the client, -and lessen the likelyhood that a client will work on unix but not on -Windows. - -### It's more flexible than `filepath.Walk` - -#### Configurable Handling of Symbolic Links - -The default behavior of this library is to ignore symbolic links to -directories when walking a directory tree, just like `filepath.Walk` -does. However, it does invoke the callback function with each node it -finds, including symbolic links. If a particular use case exists to -follow symbolic links when traversing a directory tree, this library -can be invoked in manner to do so, by setting the -`FollowSymbolicLinks` parameter to true. - -#### Configurable Sorting of Directory Children - -The default behavior of this library is to always sort the immediate -descendants of a directory prior to visiting each node, just like -`filepath.Walk` does. This is usually the desired behavior. However, -this does come at slight performance and memory penalties required to -sort the names when a directory node has many entries. Additionally if -caller specifies `Unsorted` enumeration, reading directories is lazily -performed as the caller consumes entries. If a particular use case -exists that does not require sorting the directory's immediate -descendants prior to visiting its nodes, this library will skip the -sorting step when the `Unsorted` parameter is set to true. - -#### Configurable Post Children Callback - -This library provides upstream code with the ability to specify a -callback to be invoked for each directory after its children are -processed. This has been used to recursively delete empty directories -after traversing the file system in a more efficient manner. See the -`examples/clean-empties` directory for an example of this usage. - -#### Configurable Error Callback - -This library provides upstream code with the ability to specify a -callback to be invoked for errors that the operating system returns, -allowing the upstream code to determine the next course of action to -take, whether to halt walking the hierarchy, as it would do were no -error callback provided, or skip the node that caused the error. See -the `examples/walk-fast` directory for an example of this usage. diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/debug_development.go b/v2/internal/takeon/github.com/karrick/godirwalk/debug_development.go deleted file mode 100644 index 6e1cb0b..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/debug_development.go +++ /dev/null @@ -1,14 +0,0 @@ -// +build godirwalk_debug - -package godirwalk - -import ( - "fmt" - "os" -) - -// debug formats and prints arguments to stderr for development builds -func debug(f string, a ...interface{}) { - // fmt.Fprintf(os.Stderr, f, a...) - os.Stderr.Write([]byte("godirwalk: " + fmt.Sprintf(f, a...))) -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/debug_release.go b/v2/internal/takeon/github.com/karrick/godirwalk/debug_release.go deleted file mode 100644 index 9861787..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/debug_release.go +++ /dev/null @@ -1,6 +0,0 @@ -// +build !godirwalk_debug - -package godirwalk - -// debug is a no-op for release builds -func debug(_ string, _ ...interface{}) {} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/dirent.go b/v2/internal/takeon/github.com/karrick/godirwalk/dirent.go deleted file mode 100644 index 3bee8b2..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/dirent.go +++ /dev/null @@ -1,90 +0,0 @@ -package godirwalk - -import ( - "os" - "path/filepath" -) - -// Dirent stores the name and file system mode type of discovered file system -// entries. -type Dirent struct { - name string // name is the basename of the file system entry. - modeType os.FileMode // modeType is the type of file system entry. -} - -// NewDirent returns a newly initialized Dirent structure, or an error. This -// function does not follow symbolic links. -// -// This function is rarely used, as Dirent structures are provided by other -// functions in this library that read and walk directories, but is provided, -// however, for the occasion when a program needs to create a Dirent. -func NewDirent(osPathname string) (*Dirent, error) { - modeType, err := modeType(osPathname) - if err != nil { - return nil, err - } - return &Dirent{ - name: filepath.Base(osPathname), - modeType: modeType, - }, nil -} - -// // dup returns a duplicate of the directory entry. -// func (de Dirent) dup() *Dirent { -// return &Dirent{ -// name: de.name, -// modeType: de.modeType, -// } -// } - -// Name returns the basename of the file system entry. -func (de Dirent) Name() string { return de.name } - -// ModeType returns the mode bits that specify the file system node type. We -// could make our own enum-like data type for encoding the file type, but Go's -// runtime already gives us architecture independent file modes, as discussed in -// `os/types.go`: -// -// Go's runtime FileMode type has same definition on all systems, so that -// information about files can be moved from one system to another portably. -func (de Dirent) ModeType() os.FileMode { return de.modeType } - -// IsDir returns true if and only if the Dirent represents a file system -// directory. Note that on some operating systems, more than one file mode bit -// may be set for a node. For instance, on Windows, a symbolic link that points -// to a directory will have both the directory and the symbolic link bits set. -func (de Dirent) IsDir() bool { return de.modeType&os.ModeDir != 0 } - -// IsRegular returns true if and only if the Dirent represents a regular file. -// That is, it ensures that no mode type bits are set. -func (de Dirent) IsRegular() bool { return de.modeType&os.ModeType == 0 } - -// IsSymlink returns true if and only if the Dirent represents a file system -// symbolic link. Note that on some operating systems, more than one file mode -// bit may be set for a node. For instance, on Windows, a symbolic link that -// points to a directory will have both the directory and the symbolic link bits -// set. -func (de Dirent) IsSymlink() bool { return de.modeType&os.ModeSymlink != 0 } - -// IsDevice returns true if and only if the Dirent represents a device file. -func (de Dirent) IsDevice() bool { return de.modeType&os.ModeDevice != 0 } - -// reset releases memory held by entry err and name, and resets mode type to 0. -func (de *Dirent) reset() { - de.name = "" - de.modeType = 0 -} - -// Dirents represents a slice of Dirent pointers, which are sortable by -// name. This type satisfies the `sort.Interface` interface. -type Dirents []*Dirent - -// Len returns the count of Dirent structures in the slice. -func (l Dirents) Len() int { return len(l) } - -// Less returns true if and only if the Name of the element specified by the -// first index is lexicographically less than that of the second index. -func (l Dirents) Less(i, j int) bool { return l[i].name < l[j].name } - -// Swap exchanges the two Dirent entries specified by the two provided indexes. -func (l Dirents) Swap(i, j int) { l[i], l[j] = l[j], l[i] } diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/doc.go b/v2/internal/takeon/github.com/karrick/godirwalk/doc.go deleted file mode 100644 index 1197482..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/doc.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Package godirwalk provides functions to read and traverse directory trees. - -In short, why do I use this library? - -* It's faster than `filepath.Walk`. - -* It's more correct on Windows than `filepath.Walk`. - -* It's more easy to use than `filepath.Walk`. - -* It's more flexible than `filepath.Walk`. - -USAGE - -This library will normalize the provided top level directory name based on the -os-specific path separator by calling `filepath.Clean` on its first -argument. However it always provides the pathname created by using the correct -os-specific path separator when invoking the provided callback function. - - dirname := "some/directory/root" - err := godirwalk.Walk(dirname, &godirwalk.Options{ - Callback: func(osPathname string, de *godirwalk.Dirent) error { - fmt.Printf("%s %s\n", de.ModeType(), osPathname) - return nil - }, - }) - -This library not only provides functions for traversing a file system directory -tree, but also for obtaining a list of immediate descendants of a particular -directory, typically much more quickly than using `os.ReadDir` or -`os.ReadDirnames`. - - dirname := "some/directory" - names, err := godirwalk.ReadDirnames() -*/ -package godirwalk diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/inoWithFileno.go b/v2/internal/takeon/github.com/karrick/godirwalk/inoWithFileno.go deleted file mode 100644 index 1dc04a7..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/inoWithFileno.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build dragonfly freebsd openbsd netbsd - -package godirwalk - -import "syscall" - -func inoFromDirent(de *syscall.Dirent) uint64 { - return uint64(de.Fileno) -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/inoWithIno.go b/v2/internal/takeon/github.com/karrick/godirwalk/inoWithIno.go deleted file mode 100644 index 0ec7c52..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/inoWithIno.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build aix darwin linux nacl solaris - -package godirwalk - -import "syscall" - -func inoFromDirent(de *syscall.Dirent) uint64 { - // cast necessary on file systems that store ino as different type - return uint64(de.Ino) -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/modeType.go b/v2/internal/takeon/github.com/karrick/godirwalk/modeType.go deleted file mode 100644 index 6427a68..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/modeType.go +++ /dev/null @@ -1,22 +0,0 @@ -package godirwalk - -import ( - "os" -) - -// modeType returns the mode type of the file system entry identified by -// osPathname by calling os.LStat function, to intentionally not follow symbolic -// links. -// -// Even though os.LStat provides all file mode bits, we want to ensure same -// values returned to caller regardless of whether we obtained file mode bits -// from syscall or stat call. Therefore mask out the additional file mode bits -// that are provided by stat but not by the syscall, so users can rely on their -// values. -func modeType(osPathname string) (os.FileMode, error) { - fi, err := os.Lstat(osPathname) - if err == nil { - return fi.Mode() & os.ModeType, nil - } - return 0, err -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/modeTypeWithType.go b/v2/internal/takeon/github.com/karrick/godirwalk/modeTypeWithType.go deleted file mode 100644 index 7890e77..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/modeTypeWithType.go +++ /dev/null @@ -1,37 +0,0 @@ -// +build darwin dragonfly freebsd linux netbsd openbsd - -package godirwalk - -import ( - "os" - "path/filepath" - "syscall" -) - -// modeTypeFromDirent converts a syscall defined constant, which is in purview -// of OS, to a constant defined by Go, assumed by this project to be stable. -// -// When the syscall constant is not recognized, this function falls back to a -// Stat on the file system. -func modeTypeFromDirent(de *syscall.Dirent, osDirname, osBasename string) (os.FileMode, error) { - switch de.Type { - case syscall.DT_REG: - return 0, nil - case syscall.DT_DIR: - return os.ModeDir, nil - case syscall.DT_LNK: - return os.ModeSymlink, nil - case syscall.DT_CHR: - return os.ModeDevice | os.ModeCharDevice, nil - case syscall.DT_BLK: - return os.ModeDevice, nil - case syscall.DT_FIFO: - return os.ModeNamedPipe, nil - case syscall.DT_SOCK: - return os.ModeSocket, nil - default: - // If syscall returned unknown type (e.g., DT_UNKNOWN, DT_WHT), then - // resolve actual mode by reading file information. - return modeType(filepath.Join(osDirname, osBasename)) - } -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/modeTypeWithoutType.go b/v2/internal/takeon/github.com/karrick/godirwalk/modeTypeWithoutType.go deleted file mode 100644 index 5299392..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/modeTypeWithoutType.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build aix js nacl solaris - -package godirwalk - -import ( - "os" - "path/filepath" - "syscall" -) - -// modeTypeFromDirent converts a syscall defined constant, which is in purview -// of OS, to a constant defined by Go, assumed by this project to be stable. -// -// Because some operating system syscall.Dirent structures do not include a Type -// field, fall back on Stat of the file system. -func modeTypeFromDirent(_ *syscall.Dirent, osDirname, osBasename string) (os.FileMode, error) { - return modeType(filepath.Join(osDirname, osBasename)) -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/nameWithNamlen.go b/v2/internal/takeon/github.com/karrick/godirwalk/nameWithNamlen.go deleted file mode 100644 index 2c0231e..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/nameWithNamlen.go +++ /dev/null @@ -1,29 +0,0 @@ -// +build aix darwin dragonfly freebsd netbsd openbsd - -package godirwalk - -import ( - "reflect" - "syscall" - "unsafe" -) - -func nameFromDirent(de *syscall.Dirent) []byte { - // Because this GOOS' syscall.Dirent provides a Namlen field that says how - // long the name is, this function does not need to search for the NULL - // byte. - ml := int(de.Namlen) - - // Convert syscall.Dirent.Name, which is array of int8, to []byte, by - // overwriting Cap, Len, and Data slice header fields to values from - // syscall.Dirent fields. Setting the Cap, Len, and Data field values for - // the slice header modifies what the slice header points to, and in this - // case, the name buffer. - var name []byte - sh := (*reflect.SliceHeader)(unsafe.Pointer(&name)) - sh.Cap = ml - sh.Len = ml - sh.Data = uintptr(unsafe.Pointer(&de.Name[0])) - - return name -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/nameWithoutNamlen.go b/v2/internal/takeon/github.com/karrick/godirwalk/nameWithoutNamlen.go deleted file mode 100644 index f776fbc..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/nameWithoutNamlen.go +++ /dev/null @@ -1,42 +0,0 @@ -// +build nacl linux js solaris - -package godirwalk - -import ( - "bytes" - "reflect" - "syscall" - "unsafe" -) - -// nameOffset is a compile time constant -const nameOffset = int(unsafe.Offsetof(syscall.Dirent{}.Name)) - -func nameFromDirent(de *syscall.Dirent) (name []byte) { - // Because this GOOS' syscall.Dirent does not provide a field that specifies - // the name length, this function must first calculate the max possible name - // length, and then search for the NULL byte. - ml := int(de.Reclen) - nameOffset - - // Convert syscall.Dirent.Name, which is array of int8, to []byte, by - // overwriting Cap, Len, and Data slice header fields to the max possible - // name length computed above, and finding the terminating NULL byte. - sh := (*reflect.SliceHeader)(unsafe.Pointer(&name)) - sh.Cap = ml - sh.Len = ml - sh.Data = uintptr(unsafe.Pointer(&de.Name[0])) - - if index := bytes.IndexByte(name, 0); index >= 0 { - // Found NULL byte; set slice's cap and len accordingly. - sh.Cap = index - sh.Len = index - return - } - - // NOTE: This branch is not expected, but included for defensive - // programming, and provides a hard stop on the name based on the structure - // field array size. - sh.Cap = len(de.Name) - sh.Len = sh.Cap - return -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/readdir.go b/v2/internal/takeon/github.com/karrick/godirwalk/readdir.go deleted file mode 100644 index 33cdbe3..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/readdir.go +++ /dev/null @@ -1,73 +0,0 @@ -package godirwalk - -// ReadDirents returns a sortable slice of pointers to Dirent structures, each -// representing the file system name and mode type for one of the immediate -// descendant of the specified directory. If the specified directory is a -// symbolic link, it will be resolved. -// -// The second parameter was an optional scratch buffer, but is no longer used -// because ReadDirents invokes Scanner to enumerate the contents of the -// directory. -// -// children, err := godirwalk.ReadDirents(osDirname, nil) -// if err != nil { -// return nil, errors.Wrap(err, "cannot get list of directory children") -// } -// sort.Sort(children) -// for _, child := range children { -// fmt.Printf("%s %s\n", child.ModeType, child.Name) -// } -func ReadDirents(osDirname string, _ []byte) (Dirents, error) { - var entries Dirents - scanner, err := NewScanner(osDirname) - if err != nil { - return nil, err - } - for scanner.Scan() { - if dirent, err := scanner.Dirent(); err == nil { - entries = append(entries, dirent) - } - } - if err = scanner.Err(); err != nil { - return nil, err - } - return entries, nil -} - -// ReadDirnames returns a slice of strings, representing the immediate -// descendants of the specified directory. If the specified directory is a -// symbolic link, it will be resolved. -// -// The second parameter was an optional scratch buffer, but is no longer used -// because ReadDirents invokes Scanner to enumerate the contents of the -// directory. -// -// Note that this function, depending on operating system, may or may not invoke -// the ReadDirents function, in order to prepare the list of immediate -// descendants. Therefore, if your program needs both the names and the file -// system mode types of descendants, it will always be faster to invoke -// ReadDirents directly, rather than calling this function, then looping over -// the results and calling os.Stat or os.LStat for each entry. -// -// children, err := godirwalk.ReadDirnames(osDirname, nil) -// if err != nil { -// return nil, errors.Wrap(err, "cannot get list of directory children") -// } -// sort.Strings(children) -// for _, child := range children { -// fmt.Printf("%s\n", child) -// } -func ReadDirnames(osDirname string, _ []byte) ([]string, error) { - var entries []string - scanner, err := NewScanner(osDirname) - if err != nil { - return nil, err - } - for scanner.Scan() { - entries = append(entries, scanner.Name()) - } - if err = scanner.Err(); err != nil { - return nil, err - } - return entries, nil -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/scandir_unix.go b/v2/internal/takeon/github.com/karrick/godirwalk/scandir_unix.go deleted file mode 100644 index f9a4f7e..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/scandir_unix.go +++ /dev/null @@ -1,140 +0,0 @@ -// +build !windows - -package godirwalk - -import ( - "io" - "os" - "syscall" - "unsafe" -) - -// MinimumScratchBufferSize specifies the minimum size of the scratch buffer -// that Walk, ReadDirents, ReadDirnames, and Scandir will use when reading file -// entries from the operating system. It is initialized to the result from -// calling `os.Getpagesize()` during program startup. -var MinimumScratchBufferSize = os.Getpagesize() - -// Scanner is an iterator to enumerate the contents of a directory. -type Scanner struct { - scratchBuffer []byte // read directory bytes from file system into this buffer - workBuffer []byte // points into scratchBuffer, from which we chunk out directory entries - osDirname string - childName string - err error // err is the error associated with scanning directory - statErr error // statErr is any error return while attempting to stat an entry - dh *os.File // used to close directory after done reading - de *Dirent // most recently decoded directory entry - sde *syscall.Dirent - fd int // file descriptor used to read entries from directory -} - -// NewScanner returns a new directory Scanner. -func NewScanner(osDirname string) (*Scanner, error) { - dh, err := os.Open(osDirname) - if err != nil { - return nil, err - } - scanner := &Scanner{ - scratchBuffer: make([]byte, MinimumScratchBufferSize), - osDirname: osDirname, - dh: dh, - fd: int(dh.Fd()), - } - return scanner, nil -} - -// Dirent returns the current directory entry while scanning a directory. -func (s *Scanner) Dirent() (*Dirent, error) { - if s.de == nil { - s.de = &Dirent{name: s.childName} - s.de.modeType, s.statErr = modeTypeFromDirent(s.sde, s.osDirname, s.childName) - } - return s.de, s.statErr -} - -// done is called when directory scanner unable to continue, with either the -// triggering error, or nil when there are simply no more entries to read from -// the directory. -func (s *Scanner) done(err error) { - if s.dh == nil { - return - } - cerr := s.dh.Close() - s.dh = nil - - if err == nil { - s.err = cerr - } else { - s.err = err - } - - s.osDirname, s.childName = "", "" - s.scratchBuffer, s.workBuffer = nil, nil - s.statErr, s.de, s.sde = nil, nil, nil - s.fd = 0 -} - -// Err returns the error associated with scanning a directory. -func (s *Scanner) Err() error { - s.done(s.err) - if s.err == io.EOF { - return nil - } - return s.err -} - -// Name returns the name of the current directory entry while scanning a -// directory. -func (s *Scanner) Name() string { return s.childName } - -// Scan potentially reads and then decodes the next directory entry from the -// file system. -// -// When it returns false, this releases resources used by the Scanner then -// returns any error associated with closing the file system directory resource. -func (s *Scanner) Scan() bool { - if s.err != nil { - return false - } - - for { - // When the work buffer has nothing remaining to decode, we need to load - // more data from disk. - if len(s.workBuffer) == 0 { - n, err := syscall.ReadDirent(s.fd, s.scratchBuffer) - if err != nil { - s.done(err) - return false - } - if n <= 0 { // end of directory - s.done(io.EOF) - return false - } - s.workBuffer = s.scratchBuffer[:n] // trim work buffer to number of bytes read - } - - // Loop until we have a usable file system entry, or we run out of data - // in the work buffer. - for len(s.workBuffer) > 0 { - s.sde = (*syscall.Dirent)(unsafe.Pointer(&s.workBuffer[0])) // point entry to first syscall.Dirent in buffer - s.workBuffer = s.workBuffer[s.sde.Reclen:] // advance buffer for next iteration through loop - - if inoFromDirent(s.sde) == 0 { - continue // inode set to 0 indicates an entry that was marked as deleted - } - - nameSlice := nameFromDirent(s.sde) - namlen := len(nameSlice) - if namlen == 0 || (nameSlice[0] == '.' && (namlen == 1 || (namlen == 2 && nameSlice[1] == '.'))) { - continue - } - - s.de = nil - s.childName = string(nameSlice) - return true - } - // No more data in the work buffer, so loop around in the outside loop - // to fetch more data. - } -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/scandir_windows.go b/v2/internal/takeon/github.com/karrick/godirwalk/scandir_windows.go deleted file mode 100644 index c91e279..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/scandir_windows.go +++ /dev/null @@ -1,92 +0,0 @@ -// +build windows - -package godirwalk - -import ( - "fmt" - "io" - "os" -) - -// Scanner is an iterator to enumerate the contents of a directory. -type Scanner struct { - osDirname string - dh *os.File // dh is handle to open directory - de *Dirent - err error // err is the error associated with scanning directory -} - -// NewScanner returns a new directory Scanner. -func NewScanner(osDirname string) (*Scanner, error) { - dh, err := os.Open(osDirname) - if err != nil { - return nil, err - } - scanner := &Scanner{ - osDirname: osDirname, - dh: dh, - } - return scanner, nil -} - -// Dirent returns the current directory entry while scanning a directory. -func (s *Scanner) Dirent() (*Dirent, error) { return s.de, nil } - -// done is called when directory scanner unable to continue, with either the -// triggering error, or nil when there are simply no more entries to read from -// the directory. -func (s *Scanner) done(err error) { - if s.dh == nil { - return - } - cerr := s.dh.Close() - s.dh = nil - - if err == nil { - s.err = cerr - } else { - s.err = err - } - - s.osDirname = "" - s.de = nil -} - -// Err returns the error associated with scanning a directory. -func (s *Scanner) Err() error { - s.done(s.err) - if s.err == io.EOF { - return nil - } - return s.err -} - -// Name returns the name of the current directory entry while scanning a -// directory. -func (s *Scanner) Name() string { return s.de.name } - -// Scan potentially reads and then decodes the next directory entry from the -// file system. -func (s *Scanner) Scan() bool { - if s.err != nil { - return false - } - - fileinfos, err := s.dh.Readdir(1) - if err != nil { - s.err = err - return false - } - - if l := len(fileinfos); l != 1 { - s.err = fmt.Errorf("expected a single entry rather than %d", l) - return false - } - - fi := fileinfos[0] - s.de = &Dirent{ - name: fi.Name(), - modeType: fi.Mode() & os.ModeType, - } - return true -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/scanner.go b/v2/internal/takeon/github.com/karrick/godirwalk/scanner.go deleted file mode 100644 index 1abf383..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/scanner.go +++ /dev/null @@ -1,44 +0,0 @@ -package godirwalk - -import "sort" - -type scanner interface { - Dirent() (*Dirent, error) - Err() error - Name() string - Scan() bool -} - -// sortedScanner enumerates through a directory's contents after reading the -// entire directory and sorting the entries by name. Used by walk to simplify -// its implementation. -type sortedScanner struct { - dd []*Dirent - de *Dirent -} - -func newSortedScanner(osPathname string) (*sortedScanner, error) { - deChildren, err := ReadDirents(osPathname, nil) - if err != nil { - return nil, err - } - sort.Sort(deChildren) - return &sortedScanner{dd: deChildren}, nil -} - -func (d *sortedScanner) Err() error { - d.dd, d.de = nil, nil - return nil -} - -func (d *sortedScanner) Dirent() (*Dirent, error) { return d.de, nil } - -func (d *sortedScanner) Name() string { return d.de.name } - -func (d *sortedScanner) Scan() bool { - if len(d.dd) > 0 { - d.de, d.dd = d.dd[0], d.dd[1:] - return true - } - return false -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/symdir.go b/v2/internal/takeon/github.com/karrick/godirwalk/symdir.go deleted file mode 100644 index d3f7eb0..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/symdir.go +++ /dev/null @@ -1,22 +0,0 @@ -package godirwalk - -import "os" - -func isDirectoryOrSymlinkToDirectory(de *Dirent, osPathname string) (bool, error) { - if de.IsDir() { - return true, nil - } - return isSymlinkToDirectory(de, osPathname) -} - -func isSymlinkToDirectory(de *Dirent, osPathname string) (bool, error) { - if !de.IsSymlink() { - return false, nil - } - // Need to resolve the symbolic link's referent in order to respond. - info, err := os.Stat(osPathname) - if err != nil { - return false, err - } - return info.IsDir(), nil -} diff --git a/v2/internal/takeon/github.com/karrick/godirwalk/walk.go b/v2/internal/takeon/github.com/karrick/godirwalk/walk.go deleted file mode 100644 index 7f4fcd9..0000000 --- a/v2/internal/takeon/github.com/karrick/godirwalk/walk.go +++ /dev/null @@ -1,316 +0,0 @@ -package godirwalk - -import ( - "errors" - "fmt" - "os" - "path/filepath" -) - -// DefaultScratchBuffer is a deprecated config parameter, whose usage was -// obsoleted by the introduction of the Scanner struct, and migrating -// ReadDirents, ReadDirnames, and Walk to use Scanner for enumerating directory -// contents. -const DefaultScratchBufferSize = 0 - -// Options provide parameters for how the Walk function operates. -type Options struct { - // ErrorCallback specifies a function to be invoked in the case of an error - // that could potentially be ignored while walking a file system - // hierarchy. When set to nil or left as its zero-value, any error condition - // causes Walk to immediately return the error describing what took - // place. When non-nil, this user supplied function is invoked with the OS - // pathname of the file system object that caused the error along with the - // error that took place. The return value of the supplied ErrorCallback - // function determines whether the error will cause Walk to halt immediately - // as it would were no ErrorCallback value provided, or skip this file - // system node yet continue on with the remaining nodes in the file system - // hierarchy. - // - // ErrorCallback is invoked both for errors that are returned by the - // runtime, and for errors returned by other user supplied callback - // functions. - ErrorCallback func(string, error) ErrorAction - - // FollowSymbolicLinks specifies whether Walk will follow symbolic links - // that refer to directories. When set to false or left as its zero-value, - // Walk will still invoke the callback function with symbolic link nodes, - // but if the symbolic link refers to a directory, it will not recurse on - // that directory. When set to true, Walk will recurse on symbolic links - // that refer to a directory. - FollowSymbolicLinks bool - - // Unsorted controls whether or not Walk will sort the immediate descendants - // of a directory by their relative names prior to visiting each of those - // entries. - // - // When set to false or left at its zero-value, Walk will get the list of - // immediate descendants of a particular directory, sort that list by - // lexical order of their names, and then visit each node in the list in - // sorted order. This will cause Walk to always traverse the same directory - // tree in the same order, however may be inefficient for directories with - // many immediate descendants. - // - // When set to true, Walk skips sorting the list of immediate descendants - // for a directory, and simply visits each node in the order the operating - // system enumerated them. This will be more fast, but with the side effect - // that the traversal order may be different from one invocation to the - // next. - Unsorted bool - - // Callback is a required function that Walk will invoke for every file - // system node it encounters. - Callback WalkFunc - - // PostChildrenCallback is an option function that Walk will invoke for - // every file system directory it encounters after its children have been - // processed. - PostChildrenCallback WalkFunc - - // ScratchBuffer is a deprecated config parameter, whose usage was obsoleted - // by the introduction of the Scanner struct, and migrating ReadDirents, - // ReadDirnames, and Walk to use Scanner for enumerating directory contents. - ScratchBuffer []byte -} - -// ErrorAction defines a set of actions the Walk function could take based on -// the occurrence of an error while walking the file system. See the -// documentation for the ErrorCallback field of the Options structure for more -// information. -type ErrorAction int - -const ( - // Halt is the ErrorAction return value when the upstream code wants to halt - // the walk process when a runtime error takes place. It matches the default - // action the Walk function would take were no ErrorCallback provided. - Halt ErrorAction = iota - - // SkipNode is the ErrorAction return value when the upstream code wants to - // ignore the runtime error for the current file system node, skip - // processing of the node that caused the error, and continue walking the - // file system hierarchy with the remaining nodes. - SkipNode -) - -// WalkFunc is the type of the function called for each file system node visited -// by Walk. The pathname argument will contain the argument to Walk as a prefix; -// that is, if Walk is called with "dir", which is a directory containing the -// file "a", the provided WalkFunc will be invoked with the argument "dir/a", -// using the correct os.PathSeparator for the Go Operating System architecture, -// GOOS. The directory entry argument is a pointer to a Dirent for the node, -// providing access to both the basename and the mode type of the file system -// node. -// -// If an error is returned by the Callback or PostChildrenCallback functions, -// and no ErrorCallback function is provided, processing stops. If an -// ErrorCallback function is provided, then it is invoked with the OS pathname -// of the node that caused the error along along with the error. The return -// value of the ErrorCallback function determines whether to halt processing, or -// skip this node and continue processing remaining file system nodes. -// -// The exception is when the function returns the special value -// filepath.SkipDir. If the function returns filepath.SkipDir when invoked on a -// directory, Walk skips the directory's contents entirely. If the function -// returns filepath.SkipDir when invoked on a non-directory file system node, -// Walk skips the remaining files in the containing directory. Note that any -// supplied ErrorCallback function is not invoked with filepath.SkipDir when the -// Callback or PostChildrenCallback functions return that special value. -type WalkFunc func(osPathname string, directoryEntry *Dirent) error - -// Walk walks the file tree rooted at the specified directory, calling the -// specified callback function for each file system node in the tree, including -// root, symbolic links, and other node types. The nodes are walked in lexical -// order, which makes the output deterministic but means that for very large -// directories this function can be inefficient. -// -// This function is often much faster than filepath.Walk because it does not -// invoke os.Stat for every node it encounters, but rather obtains the file -// system node type when it reads the parent directory. -// -// If a runtime error occurs, either from the operating system or from the -// upstream Callback or PostChildrenCallback functions, processing typically -// halts. However, when an ErrorCallback function is provided in the provided -// Options structure, that function is invoked with the error along with the OS -// pathname of the file system node that caused the error. The ErrorCallback -// function's return value determines the action that Walk will then take. -// -// func main() { -// dirname := "." -// if len(os.Args) > 1 { -// dirname = os.Args[1] -// } -// err := godirwalk.Walk(dirname, &godirwalk.Options{ -// Callback: func(osPathname string, de *godirwalk.Dirent) error { -// fmt.Printf("%s %s\n", de.ModeType(), osPathname) -// return nil -// }, -// ErrorCallback: func(osPathname string, err error) godirwalk.ErrorAction { -// // Your program may want to log the error somehow. -// fmt.Fprintf(os.Stderr, "ERROR: %s\n", err) -// -// // For the purposes of this example, a simple SkipNode will suffice, -// // although in reality perhaps additional logic might be called for. -// return godirwalk.SkipNode -// }, -// }) -// if err != nil { -// fmt.Fprintf(os.Stderr, "%s\n", err) -// os.Exit(1) -// } -// } -func Walk(pathname string, options *Options) error { - if options.Callback == nil { - return errors.New("cannot walk without a specified Callback function") - } - - pathname = filepath.Clean(pathname) - - var fi os.FileInfo - var err error - - if options.FollowSymbolicLinks { - fi, err = os.Stat(pathname) - if err != nil { - return err - } - } else { - fi, err = os.Lstat(pathname) - if err != nil { - return err - } - } - - mode := fi.Mode() - if mode&os.ModeDir == 0 { - return fmt.Errorf("cannot Walk non-directory: %s", pathname) - } - - // If ErrorCallback is nil, set to a default value that halts the walk - // process on all operating system errors. This is done to allow error - // handling to be more succinct in the walk code. - if options.ErrorCallback == nil { - options.ErrorCallback = defaultErrorCallback - } - - dirent := &Dirent{ - name: filepath.Base(pathname), - modeType: mode & os.ModeType, - } - - err = walk(pathname, dirent, options) - if err == filepath.SkipDir { - return nil // silence SkipDir for top level - } - return err -} - -// defaultErrorCallback always returns Halt because if the upstream code did not -// provide an ErrorCallback function, walking the file system hierarchy ought to -// halt upon any operating system error. -func defaultErrorCallback(_ string, _ error) ErrorAction { return Halt } - -// walk recursively traverses the file system node specified by pathname and the -// Dirent. -func walk(osPathname string, dirent *Dirent, options *Options) error { - err := options.Callback(osPathname, dirent) - if err != nil { - if err == filepath.SkipDir { - return err - } - if action := options.ErrorCallback(osPathname, err); action == SkipNode { - return nil - } - return err - } - - if dirent.IsSymlink() { - if !options.FollowSymbolicLinks { - return nil - } - isDir, err := isSymlinkToDirectory(dirent, osPathname) - if err != nil { - if action := options.ErrorCallback(osPathname, err); action == SkipNode { - return nil - } - return err - } - if !isDir { - return nil - } - } else if !dirent.IsDir() { - return nil - } - - // If get here, then specified pathname refers to a directory or a - // symbolic link to a directory. - - var ds scanner - - if options.Unsorted { - // When upstream does not request a sorted iteration, it's more memory - // efficient to read a single child at a time from the file system. - ds, err = NewScanner(osPathname) - } else { - // When upstream wants a sorted iteration, we must read the entire - // directory and sort through the child names, and then iterate on each - // child. - ds, err = newSortedScanner(osPathname) - } - if err != nil { - if action := options.ErrorCallback(osPathname, err); action == SkipNode { - return nil - } - return err - } - - for ds.Scan() { - deChild, err := ds.Dirent() - osChildname := filepath.Join(osPathname, deChild.name) - if err != nil { - if action := options.ErrorCallback(osChildname, err); action == SkipNode { - return nil - } - return err - } - err = walk(osChildname, deChild, options) - debug("osChildname: %q; error: %v\n", osChildname, err) - if err == nil { - continue - } - if err != filepath.SkipDir { - return err - } - // When received SkipDir on a directory or a symbolic link to a - // directory, stop processing that directory but continue processing - // siblings. When received on a non-directory, stop processing - // remaining siblings. - isDir, err := isDirectoryOrSymlinkToDirectory(deChild, osChildname) - if err != nil { - if action := options.ErrorCallback(osChildname, err); action == SkipNode { - continue // ignore and continue with next sibling - } - return err // caller does not approve of this error - } - if !isDir { - break // stop processing remaining siblings, but allow post children callback - } - // continue processing remaining siblings - } - if err = ds.Err(); err != nil { - return err - } - - if options.PostChildrenCallback == nil { - return nil - } - - err = options.PostChildrenCallback(osPathname, dirent) - if err == nil || err == filepath.SkipDir { - return err - } - - if action := options.ErrorCallback(osPathname, err); action == SkipNode { - return nil - } - return err -} diff --git a/v2/internal/takeon/github.com/markbates/errx/.gitignore b/v2/internal/takeon/github.com/markbates/errx/.gitignore deleted file mode 100644 index 3689718..0000000 --- a/v2/internal/takeon/github.com/markbates/errx/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -*.log -.DS_Store -doc -tmp -pkg -*.gem -*.pid -coverage -coverage.data -build/* -*.pbxuser -*.mode1v3 -.svn -profile -.console_history -.sass-cache/* -.rake_tasks~ -*.log.lck -solr/ -.jhw-cache/ -jhw.* -*.sublime* -node_modules/ -dist/ -generated/ -.vendor/ -bin/* -gin-bin -.idea/ diff --git a/v2/internal/takeon/github.com/markbates/errx/LICENSE b/v2/internal/takeon/github.com/markbates/errx/LICENSE deleted file mode 100644 index 649efd4..0000000 --- a/v2/internal/takeon/github.com/markbates/errx/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2019 Mark Bates - -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. diff --git a/v2/internal/takeon/github.com/markbates/errx/Makefile b/v2/internal/takeon/github.com/markbates/errx/Makefile deleted file mode 100644 index 0ac539f..0000000 --- a/v2/internal/takeon/github.com/markbates/errx/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -TAGS ?= "" -GO_BIN ?= "go" - -install: - $(GO_BIN) install -tags ${TAGS} -v . - make tidy - -tidy: -ifeq ($(GO111MODULE),on) - $(GO_BIN) mod tidy -else - echo skipping go mod tidy -endif - -deps: - $(GO_BIN) get -tags ${TAGS} -t ./... - make tidy - -build: - $(GO_BIN) build -v . - make tidy - -test: - $(GO_BIN) test -cover -tags ${TAGS} ./... - make tidy - -ci-deps: - $(GO_BIN) get -tags ${TAGS} -t ./... - -ci-test: - $(GO_BIN) test -tags ${TAGS} -race ./... - -lint: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - golangci-lint run --enable-all - make tidy - -update: -ifeq ($(GO111MODULE),on) - rm go.* - $(GO_BIN) mod init - $(GO_BIN) mod tidy -else - $(GO_BIN) get -u -tags ${TAGS} -endif - make test - make install - make tidy - -release-test: - $(GO_BIN) test -tags ${TAGS} -race ./... - make tidy - -release: - $(GO_BIN) get github.com/gobuffalo/release - make tidy - release -y -f version.go --skip-packr - make tidy - - - diff --git a/v2/internal/takeon/github.com/markbates/errx/SHOULDERS.md b/v2/internal/takeon/github.com/markbates/errx/SHOULDERS.md deleted file mode 100644 index b19072e..0000000 --- a/v2/internal/takeon/github.com/markbates/errx/SHOULDERS.md +++ /dev/null @@ -1,6 +0,0 @@ -# github.com/markbates/errx Stands on the Shoulders of Giants - -github.com/markbates/errx does not try to reinvent the wheel! Instead, it uses the already great wheels developed by the Go community and puts them all together in the best way possible. Without these giants, this project would not be possible. Please make sure to check them out and thank them for all of their hard work. - -Thank you to the following **GIANTS**: - diff --git a/v2/internal/takeon/github.com/markbates/errx/azure-pipelines.yml b/v2/internal/takeon/github.com/markbates/errx/azure-pipelines.yml deleted file mode 100644 index 417e2c5..0000000 --- a/v2/internal/takeon/github.com/markbates/errx/azure-pipelines.yml +++ /dev/null @@ -1,71 +0,0 @@ -variables: - GOBIN: "$(GOPATH)/bin" # Go binaries path - GOPATH: "$(system.defaultWorkingDirectory)/gopath" # Go workspace path - modulePath: "$(GOPATH)/src/github.com/$(build.repository.name)" # Path to the module"s code - -jobs: -- job: Windows - pool: - vmImage: "vs2017-win2016" - strategy: - matrix: - go 1.10: - go_version: "1.10" - go 1.11 (on): - go_version: "1.11.5" - GO111MODULE: "on" - go 1.11 (off): - go_version: "1.11.5" - GO111MODULE: "off" - go 1.12 (on): - go_version: "1.12" - GO111MODULE: "on" - go 1.12 (off): - go_version: "1.12" - GO111MODULE: "off" - steps: - - template: azure-tests.yml - -- job: macOS - pool: - vmImage: "macOS-10.13" - strategy: - matrix: - go 1.10: - go_version: "1.10" - go 1.11 (on): - go_version: "1.11.5" - GO111MODULE: "on" - go 1.11 (off): - go_version: "1.11.5" - GO111MODULE: "off" - go 1.12 (on): - go_version: "1.12" - GO111MODULE: "on" - go 1.12 (off): - go_version: "1.12" - GO111MODULE: "off" - steps: - - template: azure-tests.yml - -- job: Linux - pool: - vmImage: "ubuntu-16.04" - strategy: - matrix: - go 1.10: - go_version: "1.10" - go 1.11 (on): - go_version: "1.11.5" - GO111MODULE: "on" - go 1.11 (off): - go_version: "1.11.5" - GO111MODULE: "off" - go 1.12 (on): - go_version: "1.12" - GO111MODULE: "on" - go 1.12 (off): - go_version: "1.12" - GO111MODULE: "off" - steps: - - template: azure-tests.yml diff --git a/v2/internal/takeon/github.com/markbates/errx/azure-tests.yml b/v2/internal/takeon/github.com/markbates/errx/azure-tests.yml deleted file mode 100644 index eea5822..0000000 --- a/v2/internal/takeon/github.com/markbates/errx/azure-tests.yml +++ /dev/null @@ -1,19 +0,0 @@ -steps: - - task: GoTool@0 - inputs: - version: $(go_version) - - task: Bash@3 - inputs: - targetType: inline - script: | - mkdir -p "$(GOBIN)" - mkdir -p "$(GOPATH)/pkg" - mkdir -p "$(modulePath)" - shopt -s extglob - mv !(gopath) "$(modulePath)" - displayName: "Setup Go Workspace" - - script: | - go get -t -v ./... - go test -race ./... - workingDirectory: "$(modulePath)" - displayName: "Tests" diff --git a/v2/internal/takeon/github.com/markbates/errx/errx.go b/v2/internal/takeon/github.com/markbates/errx/errx.go deleted file mode 100644 index 5a6f639..0000000 --- a/v2/internal/takeon/github.com/markbates/errx/errx.go +++ /dev/null @@ -1,23 +0,0 @@ -package errx - -// go2 errors -type Wrapper interface { - Unwrap() error -} - -// pkg/errors -type Causer interface { - Cause() error -} - -func Unwrap(err error) error { - switch e := err.(type) { - case Wrapper: - return e.Unwrap() - case Causer: - return e.Cause() - } - return err -} - -var Cause = Unwrap diff --git a/v2/internal/takeon/github.com/markbates/errx/version.go b/v2/internal/takeon/github.com/markbates/errx/version.go deleted file mode 100644 index 82e25a1..0000000 --- a/v2/internal/takeon/github.com/markbates/errx/version.go +++ /dev/null @@ -1,4 +0,0 @@ -package errx - -// Version of errx -const Version = "v1.0.0" diff --git a/v2/internal/takeon/github.com/markbates/oncer/.gitignore b/v2/internal/takeon/github.com/markbates/oncer/.gitignore deleted file mode 100644 index 3689718..0000000 --- a/v2/internal/takeon/github.com/markbates/oncer/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -*.log -.DS_Store -doc -tmp -pkg -*.gem -*.pid -coverage -coverage.data -build/* -*.pbxuser -*.mode1v3 -.svn -profile -.console_history -.sass-cache/* -.rake_tasks~ -*.log.lck -solr/ -.jhw-cache/ -jhw.* -*.sublime* -node_modules/ -dist/ -generated/ -.vendor/ -bin/* -gin-bin -.idea/ diff --git a/v2/internal/takeon/github.com/markbates/oncer/LICENSE b/v2/internal/takeon/github.com/markbates/oncer/LICENSE deleted file mode 100644 index a538bcb..0000000 --- a/v2/internal/takeon/github.com/markbates/oncer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Mark Bates - -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. diff --git a/v2/internal/takeon/github.com/markbates/oncer/Makefile b/v2/internal/takeon/github.com/markbates/oncer/Makefile deleted file mode 100644 index 187cb8a..0000000 --- a/v2/internal/takeon/github.com/markbates/oncer/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -TAGS ?= "sqlite" -GO_BIN ?= go - -install: - packr - $(GO_BIN) install -v . - -deps: - $(GO_BIN) get github.com/gobuffalo/release - $(GO_BIN) get github.com/gobuffalo/packr/packr - $(GO_BIN) get -tags ${TAGS} -t ./... - $(GO_BIN) mod tidy - -build: - packr - $(GO_BIN) build -v . - -test: - packr - $(GO_BIN) test -tags ${TAGS} ./... - -ci-test: deps - $(GO_BIN) test -tags ${TAGS} -race ./... - -lint: - gometalinter --vendor ./... --deadline=1m --skip=internal - -update: - $(GO_BIN) get -u -tags ${TAGS} - $(GO_BIN) mod tidy - packr - make test - make install - $(GO_BIN) mod tidy - -release-test: - $(GO_BIN) test -tags ${TAGS} -race ./... - -release: - release -y -f version.go diff --git a/v2/internal/takeon/github.com/markbates/oncer/deprecate.go b/v2/internal/takeon/github.com/markbates/oncer/deprecate.go deleted file mode 100644 index 4eb3a44..0000000 --- a/v2/internal/takeon/github.com/markbates/oncer/deprecate.go +++ /dev/null @@ -1,20 +0,0 @@ -package oncer - -import ( - "fmt" - "io" - "os" -) - -const deprecated = "DEPRECATED" - -var deprecationWriter io.Writer = os.Stdout - -func Deprecate(depth int, name string, msg string) { - Do(deprecated+name, func() { - fmt.Fprintf(deprecationWriter, "[%s] %s has been deprecated.\n", deprecated, name) - if len(msg) > 0 { - fmt.Fprintf(deprecationWriter, "\t%s\n", msg) - } - }) -} diff --git a/v2/internal/takeon/github.com/markbates/oncer/log.go b/v2/internal/takeon/github.com/markbates/oncer/log.go deleted file mode 100644 index ed43463..0000000 --- a/v2/internal/takeon/github.com/markbates/oncer/log.go +++ /dev/null @@ -1,7 +0,0 @@ -//+build !debug - -package oncer - -func log(name string, fn func()) func() { - return fn -} diff --git a/v2/internal/takeon/github.com/markbates/oncer/log_debug.go b/v2/internal/takeon/github.com/markbates/oncer/log_debug.go deleted file mode 100644 index 76d0e11..0000000 --- a/v2/internal/takeon/github.com/markbates/oncer/log_debug.go +++ /dev/null @@ -1,19 +0,0 @@ -//+build debug - -package oncer - -import ( - "fmt" - "time" -) - -func log(name string, fn func()) func() { - return func() { - start := time.Now() - if len(name) > 80 { - name = name[(len(name) - 80):] - } - defer fmt.Println(name, time.Now().Sub(start)) - fn() - } -} diff --git a/v2/internal/takeon/github.com/markbates/oncer/oncer.go b/v2/internal/takeon/github.com/markbates/oncer/oncer.go deleted file mode 100644 index 5b3ab8d..0000000 --- a/v2/internal/takeon/github.com/markbates/oncer/oncer.go +++ /dev/null @@ -1,26 +0,0 @@ -package oncer - -import ( - "sync" -) - -var onces = &sync.Map{} - -func Do(name string, fn func()) { - o, _ := onces.LoadOrStore(name, &sync.Once{}) - if once, ok := o.(*sync.Once); ok { - once.Do(log(name, fn)) - } -} - -func Reset(names ...string) { - if len(names) == 0 { - onces = &sync.Map{} - return - } - - for _, n := range names { - onces.Delete(n) - onces.Delete(deprecated + n) - } -} diff --git a/v2/internal/takeon/github.com/markbates/safe/.gitignore b/v2/internal/takeon/github.com/markbates/safe/.gitignore deleted file mode 100644 index 3689718..0000000 --- a/v2/internal/takeon/github.com/markbates/safe/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -*.log -.DS_Store -doc -tmp -pkg -*.gem -*.pid -coverage -coverage.data -build/* -*.pbxuser -*.mode1v3 -.svn -profile -.console_history -.sass-cache/* -.rake_tasks~ -*.log.lck -solr/ -.jhw-cache/ -jhw.* -*.sublime* -node_modules/ -dist/ -generated/ -.vendor/ -bin/* -gin-bin -.idea/ diff --git a/v2/internal/takeon/github.com/markbates/safe/.gometalinter.json b/v2/internal/takeon/github.com/markbates/safe/.gometalinter.json deleted file mode 100644 index e4f65a3..0000000 --- a/v2/internal/takeon/github.com/markbates/safe/.gometalinter.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Enable": ["vet", "golint", "goimports", "deadcode", "gotype", "ineffassign", "misspell", "nakedret", "unconvert", "megacheck", "varcheck"] -} diff --git a/v2/internal/takeon/github.com/markbates/safe/.travis.yml b/v2/internal/takeon/github.com/markbates/safe/.travis.yml deleted file mode 100644 index cf1d2c7..0000000 --- a/v2/internal/takeon/github.com/markbates/safe/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: go - -sudo: false - -matrix: - include: - - go: "1.9.x" - - go: "1.10.x" - - go: "1.11.x" - env: - - GO111MODULE=off - - go: "1.11.x" - env: - - GO111MODULE=on - - go: "tip" - env: - - GO111MODULE=off - - go: "tip" - env: - - GO111MODULE=on - allow_failures: - - go: "tip" - -install: make deps - -script: make ci-test diff --git a/v2/internal/takeon/github.com/markbates/safe/LICENSE b/v2/internal/takeon/github.com/markbates/safe/LICENSE deleted file mode 100644 index a538bcb..0000000 --- a/v2/internal/takeon/github.com/markbates/safe/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Mark Bates - -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. diff --git a/v2/internal/takeon/github.com/markbates/safe/Makefile b/v2/internal/takeon/github.com/markbates/safe/Makefile deleted file mode 100644 index e0e2f3b..0000000 --- a/v2/internal/takeon/github.com/markbates/safe/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -TAGS ?= "sqlite" -GO_BIN ?= go - -install: - packr - $(GO_BIN) install -tags ${TAGS} -v . - make tidy - -tidy: -ifeq ($(GO111MODULE),on) - $(GO_BIN) mod tidy -else - echo skipping go mod tidy -endif - -deps: - $(GO_BIN) get github.com/gobuffalo/release - $(GO_BIN) get github.com/gobuffalo/packr/packr - $(GO_BIN) get -tags ${TAGS} -t ./... - make tidy - -build: - packr - $(GO_BIN) build -v . - make tidy - -test: - packr - $(GO_BIN) test -tags ${TAGS} ./... - make tidy - -ci-test: - $(GO_BIN) test -tags ${TAGS} -race ./... - make tidy - -lint: - gometalinter --vendor ./... --deadline=1m --skip=internal - make tidy - -update: - $(GO_BIN) get -u -tags ${TAGS} - make tidy - packr - make test - make install - make tidy - -release-test: - $(GO_BIN) test -tags ${TAGS} -race ./... - make tidy - -release: - make tidy - release -y -f version.go - make tidy diff --git a/v2/internal/takeon/github.com/markbates/safe/safe.go b/v2/internal/takeon/github.com/markbates/safe/safe.go deleted file mode 100644 index a40d208..0000000 --- a/v2/internal/takeon/github.com/markbates/safe/safe.go +++ /dev/null @@ -1,33 +0,0 @@ -package safe - -import ( - "errors" - "fmt" -) - -// Run the function safely knowing that if it panics -// the panic will be caught and returned as an error -func Run(fn func()) (err error) { - return RunE(func() error { - fn() - return nil - }) -} - -// Run the function safely knowing that if it panics -// the panic will be caught and returned as an error -func RunE(fn func() error) (err error) { - defer func() { - if err != nil { - return - } - if ex := recover(); ex != nil { - if e, ok := ex.(error); ok { - err = e - return - } - err = errors.New(fmt.Sprint(ex)) - } - }() - return fn() -} diff --git a/v2/internal/takeon/github.com/markbates/safe/shoulders.md b/v2/internal/takeon/github.com/markbates/safe/shoulders.md deleted file mode 100644 index a3821f2..0000000 --- a/v2/internal/takeon/github.com/markbates/safe/shoulders.md +++ /dev/null @@ -1,8 +0,0 @@ -# github.com/markbates/safe Stands on the Shoulders of Giants - -github.com/markbates/safe does not try to reinvent the wheel! Instead, it uses the already great wheels developed by the Go community and puts them all together in the best way possible. Without these giants this project would not be possible. Please make sure to check them out and thank them for all of their hard work. - -Thank you to the following **GIANTS**: - - -* [github.com/markbates/safe](https://godoc.org/github.com/markbates/safe) diff --git a/v2/internal/takeon/github.com/markbates/safe/version.go b/v2/internal/takeon/github.com/markbates/safe/version.go deleted file mode 100644 index e655dc5..0000000 --- a/v2/internal/takeon/github.com/markbates/safe/version.go +++ /dev/null @@ -1,3 +0,0 @@ -package safe - -const Version = "v1.0.1" diff --git a/v2/jam/parser/finder.go b/v2/jam/parser/finder.go index cdbb413..2ad808e 100644 --- a/v2/jam/parser/finder.go +++ b/v2/jam/parser/finder.go @@ -8,10 +8,10 @@ import ( "strings" "time" - "github.com/gobuffalo/packr/v2/internal/takeon/github.com/karrick/godirwalk" - "github.com/gobuffalo/packr/v2/internal/takeon/github.com/markbates/errx" - "github.com/gobuffalo/packr/v2/internal/takeon/github.com/markbates/oncer" "github.com/gobuffalo/packr/v2/plog" + "github.com/karrick/godirwalk" + "github.com/markbates/errx" + "github.com/markbates/oncer" ) type finder struct { diff --git a/v2/jam/parser/gogen.go b/v2/jam/parser/gogen.go index 436fb1f..5ba95de 100644 --- a/v2/jam/parser/gogen.go +++ b/v2/jam/parser/gogen.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/gobuffalo/packd" - "github.com/gobuffalo/packr/v2/internal/takeon/github.com/markbates/errx" + "github.com/markbates/errx" ) // ParsedFile ... diff --git a/v2/jam/parser/parser_test.go b/v2/jam/parser/parser_test.go index 045aa58..2a04411 100644 --- a/v2/jam/parser/parser_test.go +++ b/v2/jam/parser/parser_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "github.com/gobuffalo/packr/v2/internal/takeon/github.com/markbates/oncer" "github.com/gobuffalo/packr/v2/jam/parser" "github.com/gobuffalo/packr/v2/jam/store" + "github.com/markbates/oncer" "github.com/stretchr/testify/require" ) diff --git a/v2/jam/parser/roots.go b/v2/jam/parser/roots.go index 8f44d64..a550182 100644 --- a/v2/jam/parser/roots.go +++ b/v2/jam/parser/roots.go @@ -8,8 +8,8 @@ import ( "path/filepath" "time" - "github.com/gobuffalo/packr/v2/internal/takeon/github.com/karrick/godirwalk" "github.com/gobuffalo/packr/v2/plog" + "github.com/karrick/godirwalk" ) type RootsOptions struct { diff --git a/v2/jam/store/disk.go b/v2/jam/store/disk.go index ed4e0e3..9a46876 100644 --- a/v2/jam/store/disk.go +++ b/v2/jam/store/disk.go @@ -5,7 +5,6 @@ import ( "compress/gzip" "crypto/md5" "fmt" - "github.com/gobuffalo/packr/v2/internal" "go/build" "html/template" "io" @@ -18,11 +17,13 @@ import ( "strings" "sync" + "github.com/gobuffalo/packr/v2/internal" + "github.com/karrick/godirwalk" + "github.com/gobuffalo/packr/v2/file/resolver/encoding/hex" "github.com/gobuffalo/packr/v2/plog" "github.com/rogpeppe/go-internal/modfile" - "github.com/gobuffalo/packr/v2/internal/takeon/github.com/karrick/godirwalk" "github.com/gobuffalo/packr/v2/jam/parser" "golang.org/x/sync/errgroup" ) diff --git a/v2/packr.go b/v2/packr.go index 0c670b6..f0f88f1 100644 --- a/v2/packr.go +++ b/v2/packr.go @@ -4,9 +4,9 @@ import ( "fmt" "github.com/gobuffalo/packr/v2/file/resolver" - "github.com/gobuffalo/packr/v2/internal/takeon/github.com/markbates/safe" "github.com/gobuffalo/packr/v2/jam/parser" "github.com/gobuffalo/packr/v2/plog" + "github.com/markbates/safe" ) var boxes = &boxMap{}