File: dot.go

package info (click to toggle)
golang-github-makenowjust-heredoc-v2 2.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 108 kB
  • sloc: makefile: 2
file content (40 lines) | stat: -rw-r--r-- 943 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2014-2019 TSUYUSATO Kitsune
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php

// Package heredoc_dot is the set of shortcuts for dot import.
//
// It is useful for using in test, but I don't recommend to use this in
// production code.
// See https://github.com/golang/lint/issues/179.
//
// For example:
//
//     package main
//
//     import (
//     	"fmt"
//     	"runtime"
//     	. "github.com/MakeNowJust/heredoc/v2/dot"
//     )
//
//     func main() {
//     	fmt.Printf(D(`
//     		GOROOT: %s
//     		GOARCH: %s
//     		GOOS  : %s
//     	`), runtime.GOROOT(), runtime.GOARCH, runtime.GOOS)
//     }
package heredoc_dot

import "github.com/MakeNowJust/heredoc/v2"

// Shortcut heredoc.Doc.
func D(raw string) string {
	return heredoc.Doc(raw)
}

// Shortcut heredoc.Docf.
func Df(raw string, args ...interface{}) string {
	return heredoc.Docf(raw, args...)
}