Source File
lit.go
Belonging Package
github.com/dave/jennifer/jen
package jen// Lit renders a literal. Lit supports only built-in types (bool, string, int, complex128, float64,// float32, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, uintptr and complex64).// Passing any other type will panic.func ( interface{}) *Statement {return newStatement().Lit()}// Lit renders a literal. Lit supports only built-in types (bool, string, int, complex128, float64,// float32, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, uintptr and complex64).// Passing any other type will panic.func ( *Group) ( interface{}) *Statement {:= Lit().items = append(.items, )return}// Lit renders a literal. Lit supports only built-in types (bool, string, int, complex128, float64,// float32, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, uintptr and complex64).// Passing any other type will panic.func ( *Statement) ( interface{}) *Statement {:= token{typ: literalToken,content: ,}* = append(*, )return}// LitFunc renders a literal. LitFunc generates the value to render by executing the provided// function. LitFunc supports only built-in types (bool, string, int, complex128, float64, float32,// int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, uintptr and complex64).// Returning any other type will panic.func ( func() interface{}) *Statement {return newStatement().LitFunc()}// LitFunc renders a literal. LitFunc generates the value to render by executing the provided// function. LitFunc supports only built-in types (bool, string, int, complex128, float64, float32,// int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, uintptr and complex64).// Returning any other type will panic.func ( *Group) ( func() interface{}) *Statement {:= LitFunc().items = append(.items, )return}// LitFunc renders a literal. LitFunc generates the value to render by executing the provided// function. LitFunc supports only built-in types (bool, string, int, complex128, float64, float32,// int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, uintptr and complex64).// Returning any other type will panic.func ( *Statement) ( func() interface{}) *Statement {:= token{typ: literalToken,content: (),}* = append(*, )return}// LitRune renders a rune literal.func ( rune) *Statement {return newStatement().LitRune()}// LitRune renders a rune literal.func ( *Group) ( rune) *Statement {:= LitRune().items = append(.items, )return}// LitRune renders a rune literal.func ( *Statement) ( rune) *Statement {:= token{typ: literalRuneToken,content: ,}* = append(*, )return}// LitRuneFunc renders a rune literal. LitRuneFunc generates the value to// render by executing the provided function.func ( func() rune) *Statement {return newStatement().LitRuneFunc()}// LitRuneFunc renders a rune literal. LitRuneFunc generates the value to// render by executing the provided function.func ( *Group) ( func() rune) *Statement {:= LitRuneFunc().items = append(.items, )return}// LitRuneFunc renders a rune literal. LitRuneFunc generates the value to// render by executing the provided function.func ( *Statement) ( func() rune) *Statement {:= token{typ: literalRuneToken,content: (),}* = append(*, )return}// LitByte renders a byte literal.func ( byte) *Statement {return newStatement().LitByte()}// LitByte renders a byte literal.func ( *Group) ( byte) *Statement {:= LitByte().items = append(.items, )return}// LitByte renders a byte literal.func ( *Statement) ( byte) *Statement {:= token{typ: literalByteToken,content: ,}* = append(*, )return}// LitByteFunc renders a byte literal. LitByteFunc generates the value to// render by executing the provided function.func ( func() byte) *Statement {return newStatement().LitByteFunc()}// LitByteFunc renders a byte literal. LitByteFunc generates the value to// render by executing the provided function.func ( *Group) ( func() byte) *Statement {:= LitByteFunc().items = append(.items, )return}// LitByteFunc renders a byte literal. LitByteFunc generates the value to// render by executing the provided function.func ( *Statement) ( func() byte) *Statement {:= token{typ: literalByteToken,content: (),}* = append(*, )return}
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |