vendorfmt

package module
v0.0.0-...-0fde667 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2017 License: MIT Imports: 5 Imported by: 0

README

Overview

vendorfmt rewrites a vendor/vendor.json file used by https://github.com/kardianos/govendor to a more merge friendly format.

Install

go get -u github.com/magiconair/vendorfmt/cmd/vendorfmt

Usage

# format vendor/vendor.json
$ vendorfmt

# format other files
$ vendorfmt foo/bar/vendor.json
Before
{
	"comment": "",
	"ignore": "test",
	"package": [
		{
			"path": "appengine",
			"revision": ""
		},
		{
			"path": "appengine_internal",
			"revision": ""
		},
		{
			"path": "appengine_internal/base",
			"revision": ""
		}
	]
}
After
{
	"comment": "",
	"ignore": "test",
	"package": [
		{"path":"appengine","revision":""},
		{"path":"appengine_internal","revision":""},
		{"path":"appengine_internal/base","revision":""}
	]
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(b []byte) ([]byte, error)

Format renders a vendor.json file so that all entries of the 'package' element are written as single-line entries which simplifies merging.

func FormatIndent

func FormatIndent(b []byte, prefix, indent string) ([]byte, error)

func FormatString

func FormatString(s string) (string, 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