Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>err4-goNew to Visual Studio Code? Get it now.
err4-go

err4-go

lcode

|
25 installs
| (1) | Free
err4 for go via code generate
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Features

when you save golang files(main.go), copy and transform main.go to main_err4.go, the main.go must include build tag err4, if the file don't include, it will don't copy and transform to main_err4.go

//go:build err4

package main

import "errors"

func main() {
	var qTerr error
	var qTerr2 error
	_, _ = qTerr, qTerr2

	qTerr = errors.New("e")

	var e1, e2 error
	_, qTerr, qTerr2 = 7, e1, e2
}

-->

main_err4.go

//go:build !err4

// Code generated by github.com/shynome/err4 DO NOT EDIT

package main

import (
	"errors"
	"github.com/shynome/err4"
)

func main() {
	var qTerr error
	var qTerr2 error
	_, _ = qTerr, qTerr2

	_ = err4.Check(errors.New("e"))(&qTerr)
	if qTerr != nil {
		return
	}

	var e1, e2 error
	_, _, _ = err4.Check2(7, e1, e2)(nil, &qTerr, &qTerr2)
	if qTerr != nil {
		return
	}
	if qTerr2 != nil {
		return
	}
}

Requirements

  • linux only for now

Extension Settings

add build tags err4

{
  "go.buildTags": "err4"
}

Known Issues

Release Notes

Users appreciate release notes as you update your extension.

0.0.1

it works

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft