Skip to content
gofmt / 0.4.1

gofmt 0.4.1

Install from the command line:
Learn more about npm packages
$ npm install @wasm-fmt/gofmt@0.4.1
Install via package.json:
"@wasm-fmt/gofmt": "0.4.1"

About this version

Build npm

Install

npm install @wasm-fmt/gofmt

Usage

import init, { format } from '@wasm-fmt/gofmt';

await init();

const source = `
package main
import "fmt"
func main(){fmt.Println("Hello, 世界")
}
`;

const formatted = format(source);
console.log(formatted);

Vite users tip:

import init, { format } from '@wasm-fmt/gofmt/vite';

Build from source

# 1. clone this repo
git clone https://github.com/wasm-fmt/gofmt.git

# 2. install TinyGo https://tinygo.org/getting-started/install/

# 3. build
npm run build

# 4. test
npm run test

Details


Assets

  • gofmt-0.4.1.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0