diff --git a/README.md b/README.md index 0b05927..8d88e59 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ Package statics =============== +![Project status](https://img.shields.io/badge/version-1.7.0-green.svg) [![Build Status](https://semaphoreci.com/api/v1/projects/1b97afa9-77f3-43ff-ad26-749958500745/601363/badge.svg)](https://semaphoreci.com/joeybloggs/statics) [![Go Report Card](http://goreportcard.com/badge/go-playground/statics)](http://goreportcard.com/report/go-playground/statics) [![GoDoc](https://godoc.org/github.com/go-playground/statics/static?status.svg)](https://godoc.org/github.com/go-playground/statics/static) +![License](https://img.shields.io/dub/l/vibe-d.svg) Package statics embeds static files into your go applications. It provides helper methods and objects to retrieve embeded files and serve via http. @@ -16,15 +18,12 @@ It has the following **unique** features: Installation ------------ -Use go get. - - go get github.com/go-playground/statics - -or to update +```shell go get -u github.com/go-playground/statics +``` -Then import the validator package into your own code. +Then import the statics package into your own code. import "github.com/go-playground/statics" diff --git a/static/static.go b/static/static.go index a9cdc81..b218673 100644 --- a/static/static.go +++ b/static/static.go @@ -54,15 +54,8 @@ func New(config *Config, dirFile *DirFile) (*Files, error) { processFiles(files, dirFile) } else { - if config.AbsPkgPath[:7] == "$GOPATH" { - - gopath := os.Getenv("GOPATH") - - if len(gopath) == 0 { - return nil, errors.New("$GOPATH could not be found; you're setup is not correct") - } - - config.AbsPkgPath = gopath + config.AbsPkgPath[7:] + if strings.Contains(config.AbsPkgPath, "$") { + config.AbsPkgPath = os.ExpandEnv(config.AbsPkgPath) } if !filepath.IsAbs(config.AbsPkgPath) {