makenowjust/heredoc

Package heredoc provides the here-document with keeping indent.

Go

181

60 commits

updated Jan 5, 2025

See the code

README

heredoc

Version Workflow Result Go Reference

About

Package heredoc provides the here-document with keeping indent.

Import

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

Example

package main

import (
	"fmt"

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

func main() {
	fmt.Println(heredoc.Doc(`
		Lorem ipsum dolor sit amet, consectetur adipisicing elit,
		sed do eiusmod tempor incididunt ut labore et dolore magna
		aliqua. Ut enim ad minim veniam, ...
	`))
	// Output:
	// Lorem ipsum dolor sit amet, consectetur adipisicing elit,
	// sed do eiusmod tempor incididunt ut labore et dolore magna
	// aliqua. Ut enim ad minim veniam, ...
	//
}

API Document

heredoc package - github.com/MakeNowJust/heredoc/v2 - pkg.go.dev

License

This software is released under the MIT License, see LICENSE.

go
golang
heredoc
indent
library
text

Significant stargazers

James Sumners

407 followers · starred Mar 2024

Masahiro Wakame

885 followers · starred Aug 2019

Jiri Daněk

40 followers · starred Sep 2025

Mind.R.

18 followers · starred Aug 2018

makenowjust/heredoc

Package heredoc provides the here-document with keeping indent.

Go

181

60 commits

updated Jan 5, 2025

See the code

README

heredoc

Version Workflow Result Go Reference

About

Package heredoc provides the here-document with keeping indent.

Import

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

Example

package main

import (
	"fmt"

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

func main() {
	fmt.Println(heredoc.Doc(`
		Lorem ipsum dolor sit amet, consectetur adipisicing elit,
		sed do eiusmod tempor incididunt ut labore et dolore magna
		aliqua. Ut enim ad minim veniam, ...
	`))
	// Output:
	// Lorem ipsum dolor sit amet, consectetur adipisicing elit,
	// sed do eiusmod tempor incididunt ut labore et dolore magna
	// aliqua. Ut enim ad minim veniam, ...
	//
}

API Document

heredoc package - github.com/MakeNowJust/heredoc/v2 - pkg.go.dev

License

This software is released under the MIT License, see LICENSE.

go
golang
heredoc
indent
library
text

Significant stargazers

James Sumners

407 followers · starred Mar 2024

Masahiro Wakame

885 followers · starred Aug 2019

Jiri Daněk

40 followers · starred Sep 2025

Mind.R.

18 followers · starred Aug 2018