36 lines
		
	
	
		
			589 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			589 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package stardb
 | 
						|
 | 
						|
import (
 | 
						|
	"fmt"
 | 
						|
	"testing"
 | 
						|
)
 | 
						|
 | 
						|
type Useless struct {
 | 
						|
	Leader string `db:"leader"`
 | 
						|
	Usable bool   `db:"use"`
 | 
						|
	O      *Whoami
 | 
						|
}
 | 
						|
 | 
						|
type Whoami struct {
 | 
						|
	Hehe string `db:"hehe"`
 | 
						|
}
 | 
						|
 | 
						|
func Test_SetRefVal(t *testing.T) {
 | 
						|
	var hehe = Useless{
 | 
						|
		Leader: "no",
 | 
						|
	}
 | 
						|
	fmt.Printf("%+v\n", hehe)
 | 
						|
	fmt.Println(setRefValue(&hehe, "db", "leader", "sb"))
 | 
						|
	fmt.Printf("%+v\n", hehe)
 | 
						|
	fmt.Printf("%+v\n", hehe)
 | 
						|
	fmt.Println(getAllRefKey(hehe, "db"))
 | 
						|
}
 | 
						|
 | 
						|
func Test_Ref(t *testing.T) {
 | 
						|
	oooooo := Useless{
 | 
						|
		Leader: "Heheeee",
 | 
						|
	}
 | 
						|
	oooooo.O = &Whoami{"fuck"}
 | 
						|
	fmt.Println(getAllRefKey(oooooo,"db"))
 | 
						|
}
 |