mirror of
https://gitee.com/johng/gf
synced 2026-07-03 03:39:35 +08:00
23 lines
328 B
Go
23 lines
328 B
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"github.com/gogf/gf/container/gset"
|
|
)
|
|
|
|
func main() {
|
|
type Student struct {
|
|
Id int
|
|
Name string
|
|
Scores *gset.IntSet
|
|
}
|
|
s := Student{
|
|
Id: 1,
|
|
Name: "john",
|
|
Scores: gset.NewIntSetFrom([]int{100, 99, 98}),
|
|
}
|
|
b, _ := json.Marshal(s)
|
|
fmt.Println(string(b))
|
|
}
|