mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-08 10:13:44 +08:00
Token expired time fucntion is ready
This commit is contained in:
21
test/test.go
21
test/test.go
@@ -2,26 +2,9 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"openai/utils"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// leveldb 测试
|
||||
db, err := utils.NewLevelDB("data")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
err = db.Put("name", "xiaoming")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
name, err := db.Get("name")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fmt.Println("name: ", name)
|
||||
fmt.Println(time.Unix(1683336167, 0).Format("2006-01-02 15:04:05"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user