Skip to content

t-kuni/go-text-json-formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lang: EN JA

Overview

This is a CLI tool for formatting JSON strings within text literals (enclosed by `).

Before formatting:

	json = `

           {
  "key1":         "value1"      ,
        "key2": {
    "key3": 
        "value3"
  }
}

     `

After formatting:

	json = `
{
  "key1": "value1",
  "key2": {
    "key3": "value3"
  }
}`

Installation

go install github.com/t-kuni/go-text-json-formatter@X.X

Replace X.X with your Go version.

Update

go install -a github.com/t-kuni/go-text-json-formatter@X.X

Usage

# If a file is specified, it formats a single file
go-text-json-formatter ./path/to/file.go
# If a directory is specified, it formats recursively within the directory
go-text-json-formatter ./path/to/dir

This command will format the JSON strings within text literals in Go files under the specified directory.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published