lpar / gzipped

Replacement for golang http.FileServer which supports precompressed static assets.
BSD 3-Clause "New" or "Revised" License
94 stars 15 forks source link

large dependency tree #6

Closed torbenschinke closed 4 years ago

torbenschinke commented 4 years ago

I get an unexpectedly huge dependency tree, caused by github.com/golang/gddo.

go list -u -m all                                                                                                                                                                                                             tschinke@dysis
github.com/worldiety/wtk-example
cloud.google.com/go v0.16.0 [v0.55.0]
github.com/BurntSushi/toml v0.3.1
github.com/bradfitz/gomemcache v0.0.0-20170208213004-1952afaa557d [v0.0.0-20190913173617-a41fca850d0b]
github.com/davecgh/go-spew v1.1.1
github.com/fsnotify/fsnotify v1.4.3-0.20170329110642-4da3e2cfbabc [v1.4.9]
github.com/garyburd/redigo v1.1.1-0.20170914051019-70e1b1943d4f [v1.6.0]
github.com/go-stack/stack v1.6.0 [v1.8.0]
github.com/golang/gddo v0.0.0-20200324184333-3c2cc9a6329d
github.com/golang/lint v0.0.0-20170918230701-e5d664eb928e [v0.0.0-20200302205851-738671d3881b]
github.com/golang/protobuf v1.3.1 [v1.3.5]
github.com/golang/snappy v0.0.0-20170215233205-553a64147049 [v0.0.1]
github.com/google/go-cmp v0.1.1-0.20171103154506-982329095285 [v0.4.0]
github.com/googleapis/gax-go v2.0.0+incompatible
github.com/gregjones/httpcache v0.0.0-20170920190843-316c5e0ff04e [v0.0.0-20190611155906-901d90724c79]
github.com/hashicorp/hcl v0.0.0-20170914154624-68e816d1c783 [v1.0.0]
github.com/inconshreveable/log15 v0.0.0-20170622235902-74a0988b5f80 [v0.0.0-20200109203555-b30bc20e4fd1]
github.com/kr/pretty v0.2.0
github.com/kr/pty v1.1.1 [v1.1.8]
github.com/kr/text v0.1.0 [v0.2.0]
github.com/lpar/gzipped v1.1.0
github.com/magiconair/properties v1.7.4-0.20170902060319-8d7837e64d3c [v1.8.1]
github.com/mattn/go-colorable v0.0.10-0.20170816031813-ad5389df28cd [v0.1.6]
github.com/mattn/go-isatty v0.0.2 [v0.0.12]
github.com/mitchellh/mapstructure v0.0.0-20170523030023-d0303fe80992 [v1.2.2]
github.com/pelletier/go-toml v1.0.1-0.20170904195809-1d6b12b7cb29 [v1.6.0]
github.com/pmezard/go-difflib v1.0.0
github.com/spf13/afero v0.0.0-20170901052352-ee1bd8ee15a1 [v1.2.2]
github.com/spf13/cast v1.1.0 [v1.3.1]
github.com/spf13/jwalterweatherman v0.0.0-20170901151539-12bd96e66386 [v1.1.0]
github.com/spf13/pflag v1.0.1-0.20170901120850-7aff26db30c1 [v1.0.5]
github.com/spf13/viper v1.0.0 [v1.6.2]
github.com/stretchr/objx v0.1.0 [v0.2.0]
github.com/stretchr/testify v1.4.0 [v1.5.1]
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 [v0.0.0-20200323165209-0ec3e9974c59]
golang.org/x/net v0.0.0-20190603091049-60506f45cf65 [v0.0.0-20200324143707-d3edc9973b7e]
golang.org/x/oauth2 v0.0.0-20170912212905-13449ad91cb2 [v0.0.0-20200107190931-bf48bf16ab8d]
golang.org/x/sync v0.0.0-20170517211232-f52d1811a629 [v0.0.0-20200317015054-43a5402ce75a]
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a [v0.0.0-20200323222414-85ca7c5b95cd]
golang.org/x/text v0.3.2
golang.org/x/time v0.0.0-20170424234030-8be79e1e0910 [v0.0.0-20191024005414-555d28b269f0]
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e [v0.0.0-20200325203130-f53864d0dba1]
google.golang.org/api v0.0.0-20170921000349-586095a6e407 [v0.20.0]
google.golang.org/appengine v1.6.5
google.golang.org/genproto v0.0.0-20170918111702-1e559d0a00ee [v0.0.0-20200326112834-f447254575fd]
google.golang.org/grpc v1.2.1-0.20170921194603-d4b75ebd4f9f [v1.28.0]
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 [v1.0.0-20200227125254-8fa46927fb4f]
gopkg.in/yaml.v2 v2.2.2 [v2.2.8]

Looks like it is only used in fileserver.go line 46 for a little parsing. May be worth, to substitute it.

lpar commented 4 years ago

As luck would have it, I wrote my own tiny Accept: header processing library last year but never got around to polishing it up and releasing it, so I'll give it a go as a replacement.

torbenschinke commented 4 years ago

cool, that sounds nice

lpar commented 4 years ago

I've pushed a possible 2.0 version if you want to try it. There's a small change to the API, you need to use gzipped.Dir instead of http.Dir now when setting up the fileserver, so you'll need to update your go.mod import to add the v2 to the end of the module name.

I made it use github.com/kevinpollet/nego for the content negotiation as my own code was buggy and I don't want to reinvent this particular fiddly wheel...

torbenschinke commented 4 years ago

looks fine, it works great. Thx

lpar commented 4 years ago

OK, released 2.0.0.