Skip to content

Commit 534d646

Browse files
committed
Merge branch 'master' into feature-chatcount-20240521
2 parents 5a524a7 + 3b3b17a commit 534d646

File tree

7 files changed

+103
-53
lines changed

7 files changed

+103
-53
lines changed

.github/workflows/gomod2nix.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: gomod2nix auto update
1+
name: 自动更新 nix 依赖
22
on:
33
push:
44
paths:
@@ -38,3 +38,6 @@ jobs:
3838
if: ${{ !github.head_ref }}
3939
continue-on-error: true
4040
uses: peter-evans/create-pull-request@v4
41+
with:
42+
delete-branch: true
43+
branch-suffix: short-commit-hash
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: 打包最新版为 Docker Image
2+
3+
on: [push]
4+
jobs:
5+
docker-builder:
6+
name: build docker
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Check out code into the Go module directory
10+
uses: actions/checkout@master
11+
- run: sudo apt-get install -y qemu-user-static
12+
13+
- name: Set up nix
14+
uses: cachix/install-nix-action@v27
15+
with:
16+
nix_path: nixpkgs=channel:nixos-unstable
17+
extra_nix_config: |
18+
sandbox = true
19+
20+
- name: Speed Up nix
21+
uses: DeterminateSystems/magic-nix-cache-action@main
22+
23+
- name: build docker
24+
run: |
25+
mkdir output/
26+
27+
# https://discourse.nixos.org/t/nix-github-actions-aarch64/11034
28+
nix build .#packages.aarch64-linux.docker_builder -o aarch64-linux.docker --print-out-paths --option system aarch64-linux --extra-platforms aarch64-linux
29+
cp $(readlink aarch64-linux.docker) ./output/aarch64-linux.docker.tar.gz
30+
31+
nix build .#packages.x86_64-linux.docker_builder -o x86_64-linux.docker --print-out-paths --option system x86_64-linux --extra-platforms x86_64-linux
32+
cp $(readlink x86_64-linux.docker) ./output/x86_64-linux.docker.tar.gz
33+
34+
# gomod2nix did not provide this
35+
# nix build .#packages.i686-linux.docker_builder -o i686-linux.docker --print-out-paths --option system i686-linux --extra-platforms i686-linux
36+
# cp $(readlink i686-linux.docker) ./output/i686-linux.docker.tar.gz
37+
38+
- name: Upload artifact
39+
uses: actions/upload-artifact@master
40+
if: ${{ !github.head_ref }}
41+
with:
42+
path: output/

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
linters-settings:
22
errcheck:
3-
ignore: fmt:.*
43
ignoretests: true
54

65
goimports:

flake.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
nixpkgs,
1313
flake-utils,
1414
gomod2nix,
15-
}: (
16-
flake-utils.lib.eachDefaultSystem
15+
}: let
16+
allSystems = flake-utils.lib.allSystems;
17+
in (
18+
flake-utils.lib.eachSystem allSystems
1719
(system: let
1820
pkgs = nixpkgs.legacyPackages.${system};
1921

gomod2nix.toml

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ schema = 3
4141
version = "v0.0.0-20170805034717-80a9c64b256d"
4242
hash = "sha256-N19KTxh70IUBqnchFuWkrJD8uuFOIVqv1iSuN3YFIT0="
4343
[mod."github.com/ajstarks/svgo"]
44-
version = "v0.0.0-20211024235047-1546f124cd8b"
45-
hash = "sha256-sPwt5sImKFk949TzUeYEF2UiJDqHxXFJKRL2Y7JWJ6Y="
44+
version = "v0.0.0-20200320125537-f189e35d30ca"
45+
hash = "sha256-ALeRuEJN9jHjGb4wNKJcxC59vVx8Tj7hHikEGkaZZ0s="
4646
[mod."github.com/antchfx/htmlquery"]
4747
version = "v1.3.1"
4848
hash = "sha256-4ZzKk7Z+vH8ytisdtcZz/Y0MbnVVhruiO/7gtUy3ouQ="
@@ -104,11 +104,11 @@ schema = 3
104104
version = "v0.0.0-20240530074540-ec743fd5a6d6"
105105
hash = "sha256-I3xNzjrj5y0fy0dfa75V57GanfmHIHmubEn9/y0BBHw="
106106
[mod."github.com/gabriel-vasile/mimetype"]
107-
version = "v1.4.4"
108-
hash = "sha256-hGidjPQg6zXZPefto6cdRk4GYwjvbsQK+4PXs9nGsTs="
107+
version = "v1.0.4"
108+
hash = "sha256-5hl9zBo3nkPt8dZfcLoOix8lAKLm3qIkWhopoS4V34E="
109109
[mod."github.com/go-ole/go-ole"]
110-
version = "v1.3.0"
111-
hash = "sha256-tF8t3VcV71jQ4jbPL91BwR59AKDpUAFV1waIKzkXJu8="
110+
version = "v1.2.6"
111+
hash = "sha256-+oxitLeJxYF19Z6g+6CgmCHJ1Y5D8raMi2Cb3M6nXCs="
112112
[mod."github.com/golang/freetype"]
113113
version = "v0.0.0-20170609003504-e2365dfdc4a0"
114114
hash = "sha256-AHAFBd20/tqxohkWyQkui2bUef9i1HWYgk9LOIFErvA="
@@ -119,14 +119,14 @@ schema = 3
119119
version = "v1.6.0"
120120
hash = "sha256-VWl9sqUzdOuhW0KzQlv0gwwUQClYkmZwSydHG2sALYw="
121121
[mod."github.com/hajimehoshi/oto"]
122-
version = "v1.0.1"
123-
hash = "sha256-fsTbwudXwq67wQyUU001HjC/w3a4aVKMkJGxP8gAcNQ="
122+
version = "v0.7.1"
123+
hash = "sha256-eRgbEbsziY5F0oI7wAe29FepZG7uGmq2M4deouDHcXI="
124124
[mod."github.com/jfreymuth/oggvorbis"]
125-
version = "v1.0.5"
126-
hash = "sha256-jphTCaPr34ZT9Id4ZZ6zU9Vnxzy6cTjCwjpQ819eGV0="
125+
version = "v1.0.1"
126+
hash = "sha256-DpkiTLxAA/iCoiylpNRvMzvaDWtK+U4UMJYNnnCmJMU="
127127
[mod."github.com/jfreymuth/vorbis"]
128-
version = "v1.0.2"
129-
hash = "sha256-gVS+/PZ5pDnswpTQNZILcrx5ZNq9ShXd6vXn7Jabes4="
128+
version = "v1.0.0"
129+
hash = "sha256-6kTol+g3NnZ3MazD786fvraw7ydUf0RWNBzHpzgN9Jk="
130130
[mod."github.com/jinzhu/gorm"]
131131
version = "v1.9.16"
132132
hash = "sha256-qKEwgNE8NxcX1uzT20LwC1TKVmve/nIy+oxdAKlxAuc="
@@ -139,9 +139,9 @@ schema = 3
139139
[mod."github.com/kanrichan/resvg-go"]
140140
version = "v0.0.2-0.20231001163256-63db194ca9f5"
141141
hash = "sha256-plRZ3yhyCafCXmAD4vnFUoCTRsHmLp7Jn9gFKcEKbds="
142-
[mod."github.com/kr/pretty"]
143-
version = "v0.3.1"
144-
hash = "sha256-DlER7XM+xiaLjvebcIPiB12oVNjyZHuJHoRGITzzpKU="
142+
[mod."github.com/kr/text"]
143+
version = "v0.2.0"
144+
hash = "sha256-fadcWxZOORv44oak3jTxm6YcITcFxdGt4bpn869HxUE="
145145
[mod."github.com/lithammer/fuzzysearch"]
146146
version = "v1.1.8"
147147
hash = "sha256-aMMRcrlUc9CBiiNkcnWWn4hfNMNyVhrAt67kvP4D4Do="
@@ -155,8 +155,8 @@ schema = 3
155155
version = "v0.0.0-20231231122217-0372e1059ca5"
156156
hash = "sha256-Dr1xDbO+eR4Y/EpPgQ/S6g6C5etRFKWr8de77skcJR8="
157157
[mod."github.com/lufia/plan9stats"]
158-
version = "v0.0.0-20240513124658-fba389f38bae"
159-
hash = "sha256-mV2v9Af2o9y8s7mYONnUsEMxRr4oypBCJ9BhYBwx3p0="
158+
version = "v0.0.0-20211012122336-39d0f177ccd0"
159+
hash = "sha256-thb+rkDx5IeWMgw5/5jgu5gZ+6RjJAUXeMgSkJHhRlA="
160160
[mod."github.com/mattn/go-isatty"]
161161
version = "v0.0.20"
162162
hash = "sha256-qhw9hWtU5wnyFyuMbKx+7RB8ckQaFQ8D+8GKPkN3HHQ="
@@ -182,11 +182,14 @@ schema = 3
182182
version = "v1.0.0"
183183
hash = "sha256-cPxqj5tb10+MurN1Lehkk/v8KjaxXpL08+pVgL4x4Hg="
184184
[mod."github.com/power-devops/perfstat"]
185-
version = "v0.0.0-20240221224432-82ca36839d55"
186-
hash = "sha256-ujzuJ1ttQgjHQJEij4O/2+I8DZaUVZQCQgA4ysfqulI="
185+
version = "v0.0.0-20210106213030-5aafc221ea8c"
186+
hash = "sha256-ywykDYuqcMt0TvZOz1l9Z6Z2JMTYQw8cP2fT8AtpmX4="
187187
[mod."github.com/remyoudompheng/bigfft"]
188188
version = "v0.0.0-20230129092748-24d4a6f8daec"
189189
hash = "sha256-vYmpyCE37eBYP/navhaLV4oX4/nu0Z/StAocLIFqrmM="
190+
[mod."github.com/rogpeppe/go-internal"]
191+
version = "v1.12.0"
192+
hash = "sha256-qvDNCe3l84/LgrA8X4O15e1FeDcazyX91m9LmXGXX6M="
190193
[mod."github.com/shirou/gopsutil/v3"]
191194
version = "v3.24.4"
192195
hash = "sha256-ubkBxu9X4LRhI1HqkjsIShR4e8rQsuKQs4VNOIIhZCU="
@@ -197,23 +200,23 @@ schema = 3
197200
version = "v1.9.3"
198201
hash = "sha256-EnxsWdEUPYid+aZ9H4/iMTs1XMvCLbXZRDyvj89Ebms="
199202
[mod."github.com/tetratelabs/wazero"]
200-
version = "v1.7.2"
201-
hash = "sha256-x/fs6ywZ0BLJOKZOfpkOkUPrnexERmKfwsmyKN+KTeg="
203+
version = "v1.5.0"
204+
hash = "sha256-fGdJM4LJrZA9jxHuYVo4EUQ3I1k0IVG3QQCBCgZkeZI="
202205
[mod."github.com/tidwall/gjson"]
203206
version = "v1.17.1"
204207
hash = "sha256-5R38cFZFaVbdem2B+9rsbr+0hRxbtDQ0i5PYWPT6kj0="
205208
[mod."github.com/tidwall/match"]
206209
version = "v1.1.1"
207210
hash = "sha256-M2klhPId3Q3T3VGkSbOkYl/2nLHnsG+yMbXkPkyrRdg="
208211
[mod."github.com/tidwall/pretty"]
209-
version = "v1.2.1"
210-
hash = "sha256-S0uTDDGD8qr415Ut7QinyXljCp0TkL4zOIrlJ+9OMl8="
212+
version = "v1.2.0"
213+
hash = "sha256-esRQGsn2Ee/CiySlwyuOICSLdqUkH4P7u8qXszos8Yc="
211214
[mod."github.com/tklauser/go-sysconf"]
212-
version = "v0.3.14"
213-
hash = "sha256-DF4NKSQTv5Z0T89MGqao7GIABcYIazZXTIUHpKIud04="
215+
version = "v0.3.12"
216+
hash = "sha256-91VBZNb3L2TZkEETF1AE4wnraLoGxKeofUbC5ZiWVHk="
214217
[mod."github.com/tklauser/numcpus"]
215-
version = "v0.8.0"
216-
hash = "sha256-owNkpN5t3BL8huRO5uMwdAI9qhJxFp9SY6O1oEcWc6k="
218+
version = "v0.6.1"
219+
hash = "sha256-8eFcw4YI0w6+GPhU5xMMQjiio94q/O5PpNO3QsvXve0="
217220
[mod."github.com/wcharczuk/go-chart/v2"]
218221
version = "v2.1.1"
219222
hash = "sha256-emvjt/ze8skM+MBflwV0EgS/svpaEGU/mn27Ie4VTXs="
@@ -226,40 +229,38 @@ schema = 3
226229
[mod."gitlab.com/gomidi/midi/v2"]
227230
version = "v2.1.7"
228231
hash = "sha256-fbgxSMCk7PVII3sNEKuGWbN56fy3eM564Xb+lnYTxRQ="
229-
[mod."golang.org/x/exp/shiny"]
230-
version = "v0.0.0-20240529005216-23cca8864a10"
231-
hash = "sha256-mejC1IeK7WnxQ9I2Z7WdmpDXIMKUYIE4Lh6WfqNtBpg="
232+
[mod."golang.org/x/exp"]
233+
version = "v0.0.0-20190306152737-a1d7652674e8"
234+
hash = "sha256-VJ0sxFsqnx2O/NmXamL2F5bQeUw5sizVQ7NLusceK5Q="
232235
[mod."golang.org/x/image"]
233236
version = "v0.16.0"
234237
hash = "sha256-+BOLefaFM/c+AV3kmnNvztbhZ+a9GCNwkEya8hZSKYg="
235238
[mod."golang.org/x/mobile"]
236-
version = "v0.0.0-20240520174638-fa72addaaa1b"
237-
hash = "sha256-FxBRegsQBIRF+3GyFOSMoPjwk9MQkQBK1VWqI2/CVh0="
239+
version = "v0.0.0-20190415191353-3e0bab5405d6"
240+
hash = "sha256-Ds7JS9muxzDc7WgCncAd0rMSFeBI88/I0dQsk13/56k="
238241
[mod."golang.org/x/net"]
239-
version = "v0.25.0"
240-
hash = "sha256-IjFfXLYNj27WLF7vpkZ6mfFXBnp+7QER3OQ0RgjxN54="
242+
version = "v0.24.0"
243+
hash = "sha256-w1c21ljta5wNIyel9CSIn/crPzwOCRofNKhqmfs4aEQ="
241244
[mod."golang.org/x/sys"]
242245
version = "v0.20.0"
243246
hash = "sha256-mowlaoG2k4n1c1rApWef5EMiXd3I77CsUi8jPh6pTYA="
244247
[mod."golang.org/x/text"]
245248
version = "v0.15.0"
246249
hash = "sha256-pBnj0AEkfkvZf+3bN7h6epCD2kurw59clDP7yWvxKlk="
247-
[mod."gopkg.in/check.v1"]
248-
version = "v1.0.0-20201130134442-10cb98267c6c"
249-
hash = "sha256-VlIpM2r/OD+kkyItn6vW35dyc0rtkJufA93rjFyzncs="
250250
[mod."gopkg.in/yaml.v3"]
251251
version = "v3.0.1"
252252
hash = "sha256-FqL9TKYJ0XkNwJFnq9j0VvJ5ZUU1RvH/52h/f5bkYAU="
253253
[mod."modernc.org/libc"]
254-
version = "v1.50.9"
255-
hash = "sha256-kvHq3zqoQQqhR5lrTj8C1j3q6mcCyi+bTlJnpAT7P9k="
254+
version = "v0.0.0-20240530081950-6f6d8586b5c5"
255+
hash = "sha256-SJYYRaiDUmIbqy9l/IgiT/4VkFsPYsaslqGEowut34w="
256+
replaced = "github.com/fumiama/libc"
256257
[mod."modernc.org/mathutil"]
257258
version = "v1.6.0"
258259
hash = "sha256-lfuEiS1odd2TWrTylnaGihSJ9myqKs3FLdpvd7PqTnE="
259260
[mod."modernc.org/memory"]
260261
version = "v1.8.0"
261262
hash = "sha256-ucvPr73zg8LjvU+bcoIPKTgwgcon3U9VhKrLEMH81xg="
262263
[mod."modernc.org/sqlite"]
263-
version = "v1.20.0-with-win386"
264-
hash = "sha256-ICV8xqeBvySJtmVV4DpqihUyRbXdaq11ba+UvMltFn8="
264+
version = "v1.29.10-simp"
265+
hash = "sha256-HCUVN6gZDG0g2WIsQ4ksqE1+XR1IjxvnqEBEU2MO1eE="
265266
replaced = "github.com/fumiama/sqlite3"

plugin/moyu/holiday_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,31 @@ func TestSetHoliday(t *testing.T) {
2323
t.Fatal(err)
2424
}
2525

26-
err = SetHoliday("元旦", 1, 2024, 1, 1)
26+
err = SetHoliday("元旦", 1, 2025, 1, 1)
2727
if err != nil {
2828
t.Fatal(err)
2929
}
30-
err = SetHoliday("春节", 7, 2024, 2, 10)
30+
err = SetHoliday("春节", 7, 2025, 1, 29)
3131
if err != nil {
3232
t.Fatal(err)
3333
}
34-
err = SetHoliday("清明节", 1, 2024, 4, 5)
34+
err = SetHoliday("清明节", 1, 2025, 4, 4)
3535
if err != nil {
3636
t.Fatal(err)
3737
}
38-
err = SetHoliday("劳动节", 1, 2024, 5, 1)
38+
err = SetHoliday("劳动节", 1, 2025, 5, 1)
3939
if err != nil {
4040
t.Fatal(err)
4141
}
42-
err = SetHoliday("端午节", 1, 2023, 6, 10)
42+
err = SetHoliday("端午节", 3, 2024, 6, 8)
4343
if err != nil {
4444
t.Fatal(err)
4545
}
46-
err = SetHoliday("中秋节", 2, 2023, 9, 29)
46+
err = SetHoliday("中秋节", 3, 2024, 9, 15)
4747
if err != nil {
4848
t.Fatal(err)
4949
}
50-
err = SetHoliday("国庆节", 6, 2023, 10, 1)
50+
err = SetHoliday("国庆节", 7, 2024, 10, 1)
5151
if err != nil {
5252
t.Fatal(err)
5353
}

plugin/moyu/nowork.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ func GetHoliday(name string) *Holiday {
3232
if err != nil {
3333
return NewHoliday(name+err.Error(), 0, 0, 0, 0)
3434
}
35-
fmt.Sscanf(ret, "%d_%d_%d_%d", &dur, &year, &month, &day)
35+
_, err = fmt.Sscanf(ret, "%d_%d_%d_%d", &dur, &year, &month, &day)
36+
if err != nil {
37+
return NewHoliday(name+err.Error(), 0, 0, 0, 0)
38+
}
3639
logrus.Debugln("[moyu]获取节日:", name, dur, year, month, day)
3740
return NewHoliday(name, dur, year, month, day)
3841
}

0 commit comments

Comments
 (0)