Skip to content

Commit b4bee2d

Browse files
committed
feat: migrate to Go module
1 parent 8f1ce1e commit b4bee2d

36 files changed

+63
-62
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Simple command line based HTTP file server to share local file system.
1515
## Compile
1616
Minimal required Go version is 1.18.
1717
```sh
18-
GO111MODULE=auto go build src/main.go
18+
go build src/main.go
1919
```
2020
Will generate executable file "main" in current directory.
2121

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
## 编译
1616
至少需要Go 1.18版本。
1717
```sh
18-
GO111MODULE=auto go build src/main.go
18+
go build src/main.go
1919
```
2020
会在当前目录生成"main"可执行文件。
2121

build/build-docker-image-dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
FROM golang AS builder
2-
ENV GO111MODULE=auto
32
COPY .git/ /mnt/ghfs/.git/
43
COPY src/ /mnt/ghfs/src/
54
COPY build/ /mnt/ghfs/build/

build/build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
cd $(dirname "$0")
44

5-
export GO111MODULE=auto
65
source ./build.inc.sh
76

87
mkdir -p "$OUTDIR"

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module mjpclab.dev/ghfs
2+
3+
go 1.19

src/app/accessibleUrls.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package app
22

33
import (
4-
"../goVirtualHost"
5-
"../util"
4+
"mjpclab.dev/ghfs/src/goVirtualHost"
5+
"mjpclab.dev/ghfs/src/util"
66
"strconv"
77
)
88

src/app/main.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package app
22

33
import (
4-
"../goVirtualHost"
5-
"../param"
6-
"../serverError"
7-
"../serverHandler"
8-
"../serverLog"
9-
"../setting"
10-
"../tpl"
11-
"../util"
4+
"mjpclab.dev/ghfs/src/goVirtualHost"
5+
"mjpclab.dev/ghfs/src/param"
6+
"mjpclab.dev/ghfs/src/serverError"
7+
"mjpclab.dev/ghfs/src/serverHandler"
8+
"mjpclab.dev/ghfs/src/serverLog"
9+
"mjpclab.dev/ghfs/src/setting"
10+
"mjpclab.dev/ghfs/src/tpl"
11+
"mjpclab.dev/ghfs/src/util"
1212
"os"
1313
"path/filepath"
1414
"strconv"

src/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package main
22

33
import (
4-
"./app"
5-
"./param"
6-
"./serverError"
7-
"./setting"
8-
"./version"
94
"errors"
5+
"mjpclab.dev/ghfs/src/app"
6+
"mjpclab.dev/ghfs/src/param"
7+
"mjpclab.dev/ghfs/src/serverError"
8+
"mjpclab.dev/ghfs/src/setting"
9+
"mjpclab.dev/ghfs/src/version"
1010
"os"
1111
"os/signal"
1212
"syscall"

src/param/cli.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package param
22

33
import (
4-
"../goNixArgParser"
5-
"../serverError"
64
"errors"
5+
"mjpclab.dev/ghfs/src/goNixArgParser"
6+
"mjpclab.dev/ghfs/src/serverError"
77
"net/http"
88
"os"
99
"strconv"

src/param/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package param
22

33
import (
4-
"../serverError"
5-
"../util"
64
"crypto/tls"
5+
"mjpclab.dev/ghfs/src/serverError"
6+
"mjpclab.dev/ghfs/src/util"
77
"os"
88
)
99

0 commit comments

Comments
 (0)