here

package module
v0.0.0-...-5e14eb6 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: MIT Imports: 2 Imported by: 1

README

here

here is a fork of TSUYUSATO Kitsune's heredoc for shortening the import path and combining the packages.

Documentation

Overview

Package here provides creation of here-documents from raw strings.

Golang supports raw-string syntax.

doc := `
	Foo
	Bar
`

But raw-string cannot recognize indentation. Thus such content is an indented string, equivalent to

"\n\tFoo\n\tBar\n"

I don't want this!

However this problem is solved by package here.

doc := here.Doc(`
	Foo
	Bar
`)

Is equivalent to

"Foo\nBar\n"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func D

func D(raw string) string

Shortcut here.Doc.

func Df

func Df(raw string, args ...interface{}) string

Shortcut here.Docf.

func Doc

func Doc(raw string) string

Doc returns un-indented string as here-document.

func Docf

func Docf(raw string, args ...interface{}) string

Docf returns unindented and formatted string as here-document. Formatting is done as for fmt.Printf().

Types

This section is empty.

Jump to

Keyboard shortcuts

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