Document fmt.{print, println} template functions

Closes #97
This commit is contained in:
digitalcraftsman 2017-09-27 17:30:32 +02:00 committed by GitHub
parent 79a72fce9a
commit 36d7e22f5c
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,26 @@
---
title: print
linktitle: print
description: Prints the default representation of the given argument using the standard `fmt.Print` function.
godocref: https://golang.org/pkg/fmt/
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [strings]
signature: ["print INPUT"]
workson: []
hugoversion:
relatedfuncs: []
deprecated: false
---
See [the go doc](https://golang.org/pkg/fmt/) for additional information.
```
{{ print "foo" }} → "foo"
{{ print (slice 1 2 3) }} → [1 2 3]
```

View File

@ -0,0 +1,25 @@
---
title: println
linktitle: println
description: Prints the default representation of the given argument using the standard `fmt.Print` function and enforces a linebreak.
godocref: https://golang.org/pkg/fmt/
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
categories: [functions]
menu:
docs:
parent: "functions"
keywords: [strings]
signature: ["println INPUT"]
workson: []
hugoversion:
relatedfuncs: []
deprecated: false
---
See [the go doc](https://golang.org/pkg/fmt/) for additional information. `\n` denotes the linebreak but isn't printed in the templates as seen below:
```
{{ println "foo" }} → "foo\n"
```