/
servlamo
/
cue
Обзор
Документация
Войти
/
servlamo
/
cue
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
encoding/gocode/testdata/pkg1/instance.cue
39 строк
610 B
Marcel van Lohuizen
encoding/gocode: make work for definitions
17 фев 2020, 20:57
17 фев 2020, 20:57
0308a53
Код
Авторство
О чём код?
package pkg1 import ( "math" "strings" "cuelang.org/go/encoding/gocode/testdata/pkg2" ) MyStruct: { A: <=10 B: =~"cat" | *"dog" O?: OtherStruct I: pkg2.ImportMe } @go(,complete=Complete) OtherStruct: { A: strings.ContainsAny("X") P: pkg2.PickMe } String: !="" @go(,validate=ValidateCUE) SpecialString: =~"special" @go(,type=string) IgnoreThis: =~"foo" // No corresponding Go type Omit: int @go(-) // NonExisting will be omitted as there is no equivalent Go type. NonExisting: { B: string } @go(-) // ignore unexported unless explicitly enabled. foo: int Ptr: { A: math.MultipleOf(10) }