Skip to content

Commit

Permalink
build: upgrade golang to 1.23.1
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Oct 10, 2024
1 parent b097748 commit 10ec957
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/bangumi/server

go 1.22.6
go 1.23.1

require (
github.com/avast/retry-go/v4 v4.6.0
Expand All @@ -27,7 +27,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
github.com/trim21/errgo v0.0.3
github.com/trim21/go-phpserialize v0.0.22
github.com/trim21/go-phpserialize v0.1.0-alpha.3
github.com/trim21/go-redis-prometheus v0.0.0
github.com/trim21/htest v0.0.4
github.com/trim21/pkg v0.0.3
Expand Down Expand Up @@ -79,6 +79,7 @@ require (
github.com/valyala/fasttemplate v1.2.2 // indirect
go.uber.org/dig v1.18.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sync v0.8.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/trim21/errgo v0.0.3 h1:q0cUPTs+4c5NxByA4f0HUGRvlNyBlUtdxFiTKQdTE68=
github.com/trim21/errgo v0.0.3/go.mod h1:AH1KzogdvSkSPXbZq9QAuqSt1L1Eu5W8eYK32zPYv9s=
github.com/trim21/go-phpserialize v0.0.22 h1:gcs36ir5s3iPFtGrp+3uU/R1lO05Et0nuhaBdUahq0Y=
github.com/trim21/go-phpserialize v0.0.22/go.mod h1:BxWksx+mEAaKC+ekgfTHas1z25dEE3n0bZbAp+tsJUM=
github.com/trim21/go-phpserialize v0.1.0-alpha.3 h1:6Z09BQa5Sr3ODyWxOHVHeiGezkIxam2asocjJ2xkfQo=
github.com/trim21/go-phpserialize v0.1.0-alpha.3/go.mod h1:/3zMYuOzpcKOevwP3ZN0WxdVRaB3CzJh5T2i41QPgRQ=
github.com/trim21/go-redis-prometheus v0.0.0 h1:9svVIZkKaDGE1bSRbtTQdsKBzW+QEWfwc35QIF8JsfA=
github.com/trim21/go-redis-prometheus v0.0.0/go.mod h1:UTXPI/fofnsXF9/X/WtvwhAdbSOBVjLg17xDjQj9VgU=
github.com/trim21/htest v0.0.4 h1:dDIzKNdIClgtB158DlO+Xf0sfwNycmx3kfo/FJuY+eE=
Expand All @@ -429,8 +429,6 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/volatiletech/null/v9 v9.0.0 h1:JCdlHEiSRVxOi7/MABiEfdsqmuj9oTV20Ao7VvZ0JkE=
github.com/volatiletech/null/v9 v9.0.0/go.mod h1:zRFghPVahaiIMRXiUJrc6gsoG83Cm3ZoAfSTw7VHGQc=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
Expand Down Expand Up @@ -461,6 +459,8 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6 h1:lGdhQUN/cnWdSH3291CUuxSEqc+AsGTiDxPP3r2J0l4=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down
6 changes: 4 additions & 2 deletions internal/collections/infra/mysql_repo_compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ type mysqlEpCollection map[model.EpisodeID]mysqlEpCollectionItem

func deserializePhpEpStatus(phpSerialized []byte) (mysqlEpCollection, error) {
var e map[model.EpisodeID]mysqlEpCollectionItem
if err := phpserialize.Unmarshal(phpSerialized, &e); err != nil {
return nil, errgo.Wrap(err, "php deserialize")
if len(phpSerialized) != 0 {
if err := phpserialize.Unmarshal(phpSerialized, &e); err != nil {
return nil, errgo.Wrap(err, "php deserialize")
}
}

return e, nil
Expand Down
8 changes: 5 additions & 3 deletions internal/subject/mysq_repository_compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ type Tag struct {

func ParseTags(b []byte) ([]model.Tag, error) {
var tags []Tag
err := phpserialize.Unmarshal(b, &tags)
if err != nil {
return nil, errgo.Wrap(err, "ParseTags: phpserialize.Unmarshal")
if len(b) != 0 {
err := phpserialize.Unmarshal(b, &tags)
if err != nil {
return nil, errgo.Wrap(err, "ParseTags: phpserialize.Unmarshal")
}
}

return slice.MapFilter(tags, func(item Tag) (model.Tag, bool) {
Expand Down
8 changes: 5 additions & 3 deletions internal/user/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ type PrivacySettings struct {

func (settings *PrivacySettings) Unmarshal(s []byte) {
rawMap := make(map[PrivacySettingsField]ReceiveFilter, 4)
err := phpserialize.Unmarshal(s, &rawMap)
if err != nil {
return
if len(s) != 0 {
err := phpserialize.Unmarshal(s, &rawMap)
if err != nil {
return
}
}

settings.ReceivePrivateMessage = rawMap[PrivacyReceivePrivateMessage]
Expand Down

0 comments on commit 10ec957

Please sign in to comment.