Skip to content

Commit e4b5fe1

Browse files
committed
chore: 更新版本
1 parent 4e02c44 commit e4b5fe1

8 files changed

Lines changed: 25 additions & 20 deletions

File tree

backend/localcommand/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"syscall"
55
"time"
66

7-
"github.com/wsshow/gotty/server"
7+
"gotty/server"
88
)
99

1010
type Options struct {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/wsshow/gotty
1+
module gotty
22

33
go 1.23
44

main.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,21 @@ import (
1212

1313
cli "github.com/urfave/cli/v2"
1414

15-
"github.com/wsshow/gotty/backend/localcommand"
16-
"github.com/wsshow/gotty/pkg/homedir"
17-
"github.com/wsshow/gotty/server"
18-
"github.com/wsshow/gotty/utils"
19-
"github.com/wsshow/gotty/version"
15+
"gotty/backend/localcommand"
16+
17+
"gotty/pkg/homedir"
18+
19+
"gotty/server"
20+
"gotty/utils"
21+
"gotty/version"
2022
)
2123

2224
func main() {
2325
app := cli.NewApp()
2426
app.Name = "gotty"
25-
app.Version = version.Get().Version
27+
app.Version = fmt.Sprintf("%s (%s)", version.Get().Version, version.Get().BuildTime)
2628
app.Usage = "Share your terminal as a web application"
29+
app.Authors = []*cli.Author{{Name: "wsshow"}}
2730
app.HideHelpCommand = true
2831
appOptions := &server.Options{}
2932

server/handlers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/gorilla/websocket"
1616
"github.com/pkg/errors"
1717

18-
"github.com/wsshow/gotty/webtty"
18+
"gotty/webtty"
1919
)
2020

2121
func (server *Server) generateHandleWS(ctx context.Context, cancel context.CancelFunc, counter *counter) http.HandlerFunc {

server/server.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import (
1919
"github.com/gorilla/websocket"
2020
"github.com/pkg/errors"
2121

22-
"github.com/wsshow/gotty/bindata"
23-
"github.com/wsshow/gotty/pkg/homedir"
24-
"github.com/wsshow/gotty/pkg/randomstring"
25-
"github.com/wsshow/gotty/webtty"
22+
"gotty/bindata"
23+
"gotty/pkg/homedir"
24+
"gotty/pkg/randomstring"
25+
"gotty/webtty"
2626
)
2727

2828
// Server provides a webtty HTTP endpoint.

server/slave.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package server
22

33
import (
4-
"github.com/wsshow/gotty/webtty"
4+
"gotty/webtty"
55
)
66

77
// Slave is webtty.Slave with some additional methods.

utils/default.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package utils
22

33
import (
44
"fmt"
5-
"github.com/fatih/structs"
65
"reflect"
76
"strconv"
7+
8+
"github.com/fatih/structs"
89
)
910

1011
func ApplyDefaultValues(struct_ interface{}) (err error) {
@@ -15,16 +16,17 @@ func ApplyDefaultValues(struct_ interface{}) (err error) {
1516
if defaultValue == "" {
1617
continue
1718
}
18-
var val interface{}
19+
var val any
1920
switch field.Kind() {
2021
case reflect.String:
2122
val = defaultValue
2223
case reflect.Bool:
23-
if defaultValue == "true" {
24+
switch defaultValue {
25+
case "true":
2426
val = true
25-
} else if defaultValue == "false" {
27+
case "false":
2628
val = false
27-
} else {
29+
default:
2830
return fmt.Errorf("invalid bool expression: %v, use true/false", defaultValue)
2931
}
3032
case reflect.Int:

utils/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/urfave/cli/v2"
1111
"github.com/yudai/hcl"
1212

13-
"github.com/wsshow/gotty/pkg/homedir"
13+
"gotty/pkg/homedir"
1414
)
1515

1616
func GenerateFlags(options ...interface{}) (flags []cli.Flag, mappings map[string]string, err error) {

0 commit comments

Comments
 (0)