render

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2019 License: BSD-3-Clause Imports: 7 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsCode

func AsCode(v interface{}) string

AsCode takes the output of Render and converts to go code that can be re-used without modification. For example: main.example{Field1:(&render.innerStruct)(nil), Field2:(*main.InnerField){Field1:"world"}} becomes main.example{Field1: &render.innerStruct{}, Field2: &main.InnerField{Field1:"World"}}

func Render

func Render(v interface{}) string

Render converts a structure to a string representation. Unlike the "%#v" format string, this resolves pointer types' contents in structs, maps, and slices/arrays and prints their field values.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL