05_data/

directory
v0.0.0-...-42ea4af Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: MIT

README

Passing Data to Template

You get to pass one value - that's it!

Fortunately, we have many different types which that value can be including composite types which compose together values. (These are also known as aggregate data types - they aggregate together many different values).

Slice

Use this for passing in a bunch of values of the same type. We could have a []int or a []string or a slice of any type.

Map

Use this for passing in key-value data.

Struct

This is probably the most commonly used data type when passing data to templates. A struct allows you to compose together values of different types.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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