Skip to content

Commit

Permalink
update go mod
Browse files Browse the repository at this point in the history
  • Loading branch information
cxjava committed Nov 14, 2019
1 parent 9f1e1e0 commit 31618a0
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 48 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<div align="center">
<a href="https://travis-ci.org/cxjava/gosuv">
<img src="https://travis-ci.org/cxjava/gosuv.svg?branch=master" alt="Build Status">
</a>
</div>

# gosuv
[![Build Status](https://travis-ci.org/cxjava/gosuv.svg)](https://travis-ci.org/cxjava/gosuv)

Expand Down
9 changes: 0 additions & 9 deletions assets_dev.go

This file was deleted.

23 changes: 0 additions & 23 deletions assets_generate.go

This file was deleted.

5 changes: 0 additions & 5 deletions cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ func actionEdit(c *cli.Context) error {
return cmd.Run()
}

func actionVersion(c *cli.Context) error {
fmt.Printf("gosuv version %s\n", version)
return nil
}

func actionReload(c *cli.Context) error {
ret, err := postForm("/api/reload", nil)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ require (
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
github.com/smartystreets/goconvey v1.6.4
github.com/stretchr/testify v1.4.0 // indirect
github.com/urfave/cli v1.22.1
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk=
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd h1:ug7PpSOB5RBPK1Kg6qskGBoP3Vnj/aNYFTznWvlkGo0=
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
Expand Down
23 changes: 23 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package main

import (
"fmt"
)

var (
Version = "dev"
Commit = "none"
RepoUrl = "unknown"
BuildDate = "unknown"
BuiltBy = "unknown"
BuiltWithGoVersion = "unknown"
)

func showVersion() {
fmt.Println("Version: \t" + Version)
fmt.Println("Build Time: \t" + BuildDate)
fmt.Println("Go Version: \t" + BuiltWithGoVersion)
fmt.Println("Repo URL: \t" + RepoUrl)
fmt.Println("Commit Info: \t" + Commit)
fmt.Println("Build By: \t" + BuiltBy)
}
10 changes: 5 additions & 5 deletions web.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import (
"syscall"
"time"

"github.com/cxjava/gosuv/assets"
"github.com/cxjava/gosuv/gops"
"github.com/cxjava/gosuv/log"
"github.com/cxjava/kexec"
"github.com/go-yaml/yaml"
"github.com/gorilla/mux"
"github.com/gorilla/websocket"
"github.com/cxjava/gosuv/log"
_ "github.com/shurcooL/vfsgen"
)

var defaultGosuvDir string
Expand All @@ -34,7 +34,7 @@ func init() {
if defaultGosuvDir == "" {
defaultGosuvDir = filepath.Join(UserHomeDir(), ".gosuv")
}
http.Handle("/res/", http.StripPrefix("/res/", http.FileServer(Assets))) // http.StripPrefix("/res/", Assets))
http.Handle("/res/", http.StripPrefix("/res/", http.FileServer(assets.HTTP))) // http.StripPrefix("/res/", Assets))
}

type Supervisor struct {
Expand Down Expand Up @@ -238,7 +238,7 @@ type WebConfig struct {
}

func (s *Supervisor) renderHTML(w http.ResponseWriter, name string, data interface{}) {
file, err := Assets.Open(name + ".html")
file, err := assets.HTTP.Open(name + ".html")
if err != nil {
panic(err)
}
Expand All @@ -247,7 +247,7 @@ func (s *Supervisor) renderHTML(w http.ResponseWriter, name string, data interfa

if data == nil {
wc := WebConfig{}
wc.Version = version
wc.Version = Version
user, err := user.Current()
if err == nil {
wc.User = user.Username
Expand Down

0 comments on commit 31618a0

Please sign in to comment.