Skip to content

Commit a80809f

Browse files
authored
升级go版本,将sqlite库换成 glebarez/sqlite 无CGO依赖版 (#155)
1 parent 154b353 commit a80809f

File tree

10 files changed

+191
-407
lines changed

10 files changed

+191
-407
lines changed

.github/pull-request-template.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@
99

1010
**填写PR内容:**
1111

12-
-
1312
-
1413
-

.github/workflows/go-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ jobs:
99
steps:
1010
- uses: actions/setup-go@v3
1111
with:
12-
go-version: 1.17
12+
go-version: 1.18
1313
- uses: actions/checkout@v3
1414
- name: golangci-lint
1515
uses: golangci/golangci-lint-action@v3
1616
with:
17-
version: v1.46.2
17+
version: v1.47.3
1818
args: --timeout=5m
1919
build:
2020
name: go-build
@@ -24,6 +24,6 @@ jobs:
2424
- name: Set up Go
2525
uses: actions/setup-go@v3
2626
with:
27-
go-version: 1.17
27+
go-version: 1.18
2828
- name: Build
2929
run: go build -v ./...
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Issue Check Inactive
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 */15 * *"
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
issue-check-inactive:
12+
permissions:
13+
issues: write # for actions-cool/issues-helper to update issues
14+
pull-requests: write # for actions-cool/issues-helper to update PRs
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: check-inactive
18+
uses: actions-cool/issues-helper@v3
19+
with:
20+
actions: 'check-inactive'
21+
inactive-label: 'Inactive'
22+
inactive-day: 30
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Issue Close Require
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
issue-close-require:
12+
permissions:
13+
issues: write # for actions-cool/issues-helper to update issues
14+
pull-requests: write # for actions-cool/issues-helper to update PRs
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: need reproduce
18+
uses: actions-cool/issues-helper@v3
19+
with:
20+
actions: 'close-issues'
21+
labels: '🤔 Need Reproduce'
22+
inactive-day: 3
23+
24+
- name: needs more info
25+
uses: actions-cool/issues-helper@v3
26+
with:
27+
actions: 'close-issues'
28+
labels: 'needs-more-info'
29+
inactive-day: 3
30+
body: |
31+
Since the issue was labeled with `needs-more-info`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
32+
由于该 issue 被标记为需要更多信息,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。

.github/workflows/reademe-contributors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ jobs:
1111
name: A job to automate contrib in readme
1212
steps:
1313
- name: Contribute List
14-
uses: akhilmhdh/[email protected].4
14+
uses: akhilmhdh/[email protected].6
1515
env:
1616
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.17.13-alpine3.15 AS builder
1+
FROM golang:1.18.10-alpine3.16 AS builder
22

33
# ENV GOPROXY https://goproxy.io
44

@@ -15,7 +15,7 @@ RUN sed -i 's@localhost:389@openldap:389@g' /app/config.yml \
1515
&& sed -i 's@host: localhost@host: mysql@g' /app/config.yml && go build -o go-ldap-admin .
1616

1717
### build final image
18-
FROM alpine:3.15
18+
FROM alpine:3.16
1919

2020
# we set the timezone `Asia/Shanghai` by default, you can be modified
2121
# by `docker build --build-arg="TZ=Other_Timezone ..."`

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ build-linux-arm:
1313
CGO_ENABLED=0 GOARCH=arm64 GOOS=linux go build -o go-ldap-admin main.go
1414

1515
lint:
16-
env GOGC=25 golangci-lint run --fix -j 8 -v ./...
16+
env GOGC=25 golangci-lint run --fix -j 8 -v ./... --timeout=5m

go.mod

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
module github.com/eryajf/go-ldap-admin
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/appleboy/gin-jwt/v2 v2.6.4
77
github.com/casbin/casbin/v2 v2.22.0
88
github.com/casbin/gorm-adapter/v3 v3.1.0
99
github.com/fsnotify/fsnotify v1.5.4
1010
github.com/gin-gonic/gin v1.6.3
11+
github.com/glebarez/sqlite v1.7.0
1112
github.com/go-ldap/ldap/v3 v3.4.2
1213
github.com/go-playground/locales v0.14.0
1314
github.com/go-playground/universal-translator v0.18.0
@@ -21,59 +22,66 @@ require (
2122
go.uber.org/zap v1.19.1
2223
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
2324
gopkg.in/natefinch/lumberjack.v2 v2.0.0
24-
gorm.io/driver/mysql v1.3.2
25-
gorm.io/driver/sqlite v1.3.6
26-
gorm.io/gorm v1.23.8
25+
gorm.io/driver/mysql v1.4.7
26+
gorm.io/gorm v1.24.5
2727
)
2828

2929
require (
3030
github.com/chyroc/lark v0.0.96
3131
github.com/tidwall/gjson v1.13.0
3232
github.com/wenerme/go-wecom v0.0.0-20220617125121-2ee950da3e63
33-
gorm.io/datatypes v1.0.6
33+
gorm.io/datatypes v1.1.0
3434
)
3535

3636
require (
3737
github.com/BurntSushi/toml v1.1.0 // indirect
38-
github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 // indirect
38+
github.com/dustin/go-humanize v1.0.1 // indirect
39+
github.com/glebarez/go-sqlite v1.20.3 // indirect
40+
github.com/golang-sql/sqlexp v0.1.0 // indirect
3941
github.com/golang/mock v1.6.0 // indirect
42+
github.com/google/go-cmp v0.5.9 // indirect
43+
github.com/google/uuid v1.3.0 // indirect
4044
github.com/lib/pq v1.10.4 // indirect
41-
github.com/mattn/go-sqlite3 v1.14.12 // indirect
45+
github.com/microsoft/go-mssqldb v0.17.0 // indirect
4246
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4347
github.com/modern-go/reflect2 v1.0.2 // indirect
4448
github.com/pelletier/go-toml/v2 v2.0.0 // indirect
49+
github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578 // indirect
4550
github.com/rogpeppe/go-internal v1.8.1 // indirect
4651
github.com/tidwall/match v1.1.1 // indirect
4752
github.com/tidwall/pretty v1.2.0 // indirect
4853
github.com/wenerme/go-req v0.0.0-20210907160348-d822e81276bb // indirect
4954
gopkg.in/yaml.v3 v3.0.1 // indirect
55+
modernc.org/libc v1.22.2 // indirect
56+
modernc.org/mathutil v1.5.0 // indirect
57+
modernc.org/memory v1.5.0 // indirect
58+
modernc.org/sqlite v1.20.3 // indirect
5059
)
5160

5261
require (
5362
github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c // indirect
5463
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
55-
github.com/denisenkom/go-mssqldb v0.12.0 // indirect
5664
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
5765
github.com/gin-contrib/sse v0.1.0 // indirect
5866
github.com/go-asn1-ber/asn1-ber v1.5.1 // indirect
59-
github.com/go-sql-driver/mysql v1.6.0 // indirect
67+
github.com/go-sql-driver/mysql v1.7.0 // indirect
6068
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
6169
github.com/golang/protobuf v1.5.2 // indirect
6270
github.com/hashicorp/hcl v1.0.0 // indirect
6371
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
64-
github.com/jackc/pgconn v1.11.0 // indirect
72+
github.com/jackc/pgconn v1.13.0 // indirect
6573
github.com/jackc/pgio v1.0.0 // indirect
6674
github.com/jackc/pgpassfile v1.0.0 // indirect
67-
github.com/jackc/pgproto3/v2 v2.2.0 // indirect
75+
github.com/jackc/pgproto3/v2 v2.3.1 // indirect
6876
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
69-
github.com/jackc/pgtype v1.10.0 // indirect
70-
github.com/jackc/pgx/v4 v4.15.0 // indirect
77+
github.com/jackc/pgtype v1.12.0 // indirect
78+
github.com/jackc/pgx/v4 v4.17.2 // indirect
7179
github.com/jinzhu/inflection v1.0.0 // indirect
7280
github.com/jinzhu/now v1.1.5 // indirect
7381
github.com/json-iterator/go v1.1.12
7482
github.com/leodido/go-urn v1.2.1 // indirect
7583
github.com/magiconair/properties v1.8.6 // indirect
76-
github.com/mattn/go-isatty v0.0.14 // indirect
84+
github.com/mattn/go-isatty v0.0.17 // indirect
7785
github.com/mitchellh/mapstructure v1.5.0 // indirect
7886
github.com/mozillazg/go-pinyin v0.19.0
7987
github.com/pelletier/go-toml v1.9.5 // indirect
@@ -86,13 +94,13 @@ require (
8694
github.com/ugorji/go/codec v1.2.3 // indirect
8795
go.uber.org/atomic v1.7.0 // indirect
8896
go.uber.org/multierr v1.6.0 // indirect
89-
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
90-
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect
97+
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b // indirect
98+
golang.org/x/sys v0.5.0 // indirect
9199
golang.org/x/text v0.3.7 // indirect
92100
google.golang.org/protobuf v1.28.0 // indirect
93101
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
94102
gopkg.in/ini.v1 v1.66.4 // indirect
95103
gopkg.in/yaml.v2 v2.4.0 // indirect
96-
gorm.io/driver/postgres v1.3.1 // indirect
97-
gorm.io/driver/sqlserver v1.3.1 // indirect
104+
gorm.io/driver/postgres v1.4.5 // indirect
105+
gorm.io/driver/sqlserver v1.4.1 // indirect
98106
)

0 commit comments

Comments
 (0)