فهرست منبع

更新go.mod为 1.17

zou.yingbin 4 سال پیش
والد
کامیت
b8bfbdbb5a
3فایلهای تغییر یافته به همراه28 افزوده شده و 3 حذف شده
  1. 6 1
      controllers/other/update.go
  2. 1 0
      controllers/other/upmtpgo.sh
  3. 21 2
      go.mod

+ 6 - 1
controllers/other/update.go

@@ -8,6 +8,7 @@
 package other
 
 import (
+	_ "embed"
 	"github.com/gin-gonic/gin"
 	"mtp2_if/logger"
 	"net/http"
@@ -18,6 +19,9 @@ import (
 	"strings"
 )
 
+//go:embed upmtpgo.sh
+var strShell string
+
 var IsUpdateing = false
 
 // MakeUpdateScript 生成脚本
@@ -78,7 +82,8 @@ func createsh() bool {
 
 	// 创建文件
 	if f, err := os.OpenFile(dir+"/update.sh", os.O_RDWR|os.O_CREATE, 0666); err == nil {
-		_, err = f.Write([]byte(sh))
+		_ = sh
+		_, err = f.Write([]byte(strShell))
 		f.Close()
 	} else {
 		return false

+ 1 - 0
res/sh/upmtpgo.sh → controllers/other/upmtpgo.sh

@@ -18,3 +18,4 @@ cd ..
 rm -rf upmtpgo
 pkill QueryService
 nohup `pwd`/QueryService &
+rm -f update.sh

+ 21 - 2
go.mod

@@ -1,6 +1,6 @@
 module mtp2_if
 
-go 1.13
+go 1.17
 
 require (
 	github.com/Chronokeeper/anyxml v0.0.0-20160530174208-54457d8e98c6 // indirect
@@ -46,7 +46,6 @@ require (
 	github.com/syndtr/goleveldb v1.0.0 // indirect
 	github.com/tealeg/xlsx v1.0.5 // indirect
 	github.com/tebeka/strftime v0.1.3 // indirect
-	github.com/ugorji/go v1.2.6 // indirect
 	github.com/xormplus/builder v0.0.0-20200331055651-240ff40009be // indirect
 	github.com/xormplus/core v0.0.0-20200308074340-f3bce19d5f31
 	github.com/xormplus/xorm v0.0.0-20200912034818-5d90dcd4e3d6
@@ -58,3 +57,23 @@ require (
 	gopkg.in/flosch/pongo2.v3 v3.0.0-20141028000813-5e81b817a0c4 // indirect
 	gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
 )
+
+require (
+	github.com/KyleBanks/depth v1.2.1 // indirect
+	github.com/PuerkitoBio/purell v1.1.1 // indirect
+	github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
+	github.com/fsnotify/fsnotify v1.4.7 // indirect
+	github.com/gin-contrib/sse v0.1.0 // indirect
+	github.com/go-openapi/jsonpointer v0.19.5 // indirect
+	github.com/go-openapi/jsonreference v0.19.5 // indirect
+	github.com/go-playground/locales v0.13.0 // indirect
+	github.com/go-playground/universal-translator v0.17.0 // indirect
+	github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
+	github.com/josharian/intern v1.0.0 // indirect
+	github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
+	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+	github.com/modern-go/reflect2 v1.0.1 // indirect
+	github.com/ugorji/go/codec v1.2.6 // indirect
+	golang.org/x/text v0.3.6 // indirect
+	gopkg.in/yaml.v2 v2.4.0 // indirect
+)