1
0
mirror of https://github.com/taigrr/shorturl synced 2025-01-18 04:03:16 -08:00

Removed unused config

This commit is contained in:
James Mills 2017-07-06 22:51:08 -07:00
parent 489d647a6f
commit d4b2e6eac8
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6
6 changed files with 10 additions and 27 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*.db
shorturl

View File

@ -3,11 +3,14 @@
all: dev
dev: build
./shorturl -bind 127.0.0.1:8000
./shorturl
build: clean
go get ./...
go build -o ./shorturl .
go build .
test:
go test ./...
clean:
rm -rf bin shorturl
rm -rf shorturl

View File

@ -1,5 +0,0 @@
package main
// Config ...
type Config struct {
}

View File

@ -1,13 +0,0 @@
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestZeroConfig(t *testing.T) {
assert := assert.New(t)
cfg := Config{}
}

View File

@ -8,8 +8,7 @@ import (
)
var (
db *bolt.DB
cfg Config
db *bolt.DB
)
func main() {
@ -31,5 +30,5 @@ func main() {
}
defer db.Close()
NewServer(bind, cfg).ListenAndServe()
NewServer(bind).ListenAndServe()
}

View File

@ -12,7 +12,6 @@ import (
// Server ...
type Server struct {
bind string
config Config
templates *templice.Template
router *httprouter.Router
}
@ -82,10 +81,9 @@ func (s *Server) initRoutes() {
}
// NewServer ...
func NewServer(bind string, config Config) *Server {
func NewServer(bind string) *Server {
server := &Server{
bind: bind,
config: config,
router: httprouter.New(),
templates: templice.New(rice.MustFindBox("templates")),
}