gofmtmd

package module
v0.1.3-0...-61c01ab Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

gofmtmd

GoDoc CircleCI codecov GolangCI

gofmtmd formats go source code block in Markdown. detects fenced code & formats code using gofmt.

Installation

$ go get github.com/po3rin/gofmtmd/cmd/gofmtmd

Usage

# replace Go code with formated code
$ gofmtmd testdata/testdata.md -r

# write result to file instead of stdout
$ gofmtmd testdata/testdata.md -w formatted.md

# you can use stdndard input
$ gofmtmd < testdata/testdata.md
$ echo "#hello" | gofmtmd

Help

$ gofmtmd -h
This CLI formats Go Code in Markdown.

Usage:
  gofmtmd [flags]

Flags:
  -h, --help           help for gofmtmd
  -r, --replace        replace Go code with formated code
      --version        version for gofmtmd
  -w, --write string   write result to file instead of stdout

Vim Plugin

Vim plugin version is here! this plugin lets you to run automatically when saved.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FmtGoCodeInMarkdown

func FmtGoCodeInMarkdown(md []byte) ([]byte, error)

FmtGoCodeInMarkdown formats go code in Markdown. returns error if code has syntax error.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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