@lemonneko/gofmt.js
v0.3.0
Published
A gofmt tool compiled by GopherJS
Readme
gofmt.js
A gofmt tool compiled by GopherJS.
Get started
Install by npm:
npm install @lemonneko/gofmt.jsIf you use commonjs:
const gofmt = require('@lemonneko/gofmt.js')
console.log(gofmt.format(`type Person struct {
Name string \`json:"name"\`
Age int \`json:"age"\`
}`))If you use esm:
import gofmt from '@lemonneko/gofmt.js'
console.log(gofmt.format(`type Person struct {
Name string \`json:"name"\`
Age int \`json:"age"\`
}`))The result should be:
[
'type Person struct {\n' +
'\tName string `json:"name"`\n' +
'\tAge int `json:"age"`\n' +
'}',
''
]