Skip to content

Commit

Permalink
build: compat to go1.24
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Sep 10, 2024
1 parent 1e6bfca commit cadacd3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions conv/j2p/api_amd64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build amd64 && go1.16
// +build amd64,go1.16
//go:build amd64 && go1.16 && !go1.24
// +build amd64,go1.16,!go1.24

// Copyright 2023 CloudWeGo Authors.
//
Expand Down
6 changes: 3 additions & 3 deletions conv/j2p/api_compat.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !amd64 || !go1.16
// +build !amd64 !go1.16
//go:build !amd64 || !go1.16 || go1.24
// +build !amd64 !go1.16 go1.24

// Copyright 2023 CloudWeGo Authors.
//
Expand All @@ -17,7 +17,7 @@

package j2p

import "encoding/base64"
import "encoding/base64"

func decodeBase64(src string) ([]byte, error) {
return base64.StdEncoding.DecodeString(src)
Expand Down
10 changes: 5 additions & 5 deletions internal/json/api_amd64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build amd64 && go1.16
// +build amd64,go1.16
//go:build amd64 && go1.16 && !go1.24
// +build amd64,go1.16,!go1.24

// Copyright 2023 CloudWeGo Authors.
//
Expand Down Expand Up @@ -27,11 +27,11 @@ import (
"github.com/cloudwego/dynamicgo/internal/rt"
)


var typeByte = rt.UnpackEface(byte(0)).Type

//go:nocheckptr
// NoQuote only escape inner '\' and '"' of one string, but it does add quotes besides string.
//
//go:nocheckptr
func NoQuote(buf *[]byte, val string) {
sp := rt.IndexChar(val, 0)
nb := len(val)
Expand Down Expand Up @@ -91,4 +91,4 @@ func f64toa(buf *[]byte, val float64) int {

func encodeBase64(src []byte) string {
return base64x.StdEncoding.EncodeToString(src)
}
}
6 changes: 3 additions & 3 deletions internal/json/api_compat.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !amd64 || !go1.16
// +build !amd64 !go1.16
//go:build !amd64 || !go1.16 || go1.24
// +build !amd64 !go1.16 go1.24

// Copyright 2023 CloudWeGo Authors.
//
Expand Down Expand Up @@ -102,4 +102,4 @@ func i64toa(buf *[]byte, v int64) {

func f64toa(buf *[]byte, v float64) {
*buf = strconv.AppendFloat(*buf, v, 'g', -1, 64)
}
}

0 comments on commit cadacd3

Please sign in to comment.