recursiveprint

package module
v0.0.0-...-885265d Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, v interface{})
Example
package main

import (
	"os"
)

func main() {
	type A struct {
		I1 int
		I2 int
		I3 *int
		M1 map[string]string
	}
	type B struct {
		A1 []bool
		A2 []*string
		A3 []interface{}
	}
	type C struct {
		A  A
		B  *B
		S1 string
		S2 *string
	}

	a := C{
		A: A{
			I1: 5,
			I2: 99,
			M1: map[string]string{
				"One": "1",
				"Two": "2",
			},
		},
		B: &B{
			A1: []bool{true, false, false, true},
			A2: []*string{nil, strptr("hi")},
			A3: []interface{}{nil, "hello", strptr("world"), A{}},
		},
		S1: "hello world",
	}

	Write(os.Stdout, a)

}

func strptr(s string) *string {
	return &s
}
Output:

asd

Types

This section is empty.

Jump to

Keyboard shortcuts

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