save
This commit is contained in:
parent
ef6a02719b
commit
50cb269954
@ -1,9 +1,9 @@
|
|||||||
package q5
|
package q5
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"errors"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ToInt converts a value to an integer.
|
// ToInt converts a value to an integer.
|
||||||
@ -11,6 +11,11 @@ func ToInt32[T string | int | int32 | int64 | float32 | float64](value T) int32
|
|||||||
return int32(ToInt64(value))
|
return int32(ToInt64(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ToInt converts a value to an integer.
|
||||||
|
func ToInt[T string | int32 | int64 | float32 | float64](value T) int {
|
||||||
|
return int(ToInt64(value))
|
||||||
|
}
|
||||||
|
|
||||||
// ToInt64 converts a value to an int64.
|
// ToInt64 converts a value to an int64.
|
||||||
func ToInt64[T string | int | int32 | int64 | float32 | float64](value T) int64 {
|
func ToInt64[T string | int | int32 | int64 | float32 | float64](value T) int64 {
|
||||||
var x interface{} = value
|
var x interface{} = value
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package q5
|
package q5
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
net_url "net/url"
|
net_url "net/url"
|
||||||
"io/ioutil"
|
|
||||||
"errors"
|
|
||||||
//"strings"
|
//"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
2
mysql.go
2
mysql.go
@ -1,8 +1,8 @@
|
|||||||
package q5
|
package q5
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
_ "github.com/go-sql-driver/mysql"
|
_ "github.com/go-sql-driver/mysql"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package q5
|
package q5
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
|
||||||
"strings"
|
|
||||||
"crypto/md5"
|
"crypto/md5"
|
||||||
|
"encoding/base64"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"encoding/base64"
|
|
||||||
"hash/crc32"
|
"hash/crc32"
|
||||||
|
"io"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user