DO NOT use `named return values` in Go

namedreturn

DO NOT use named return values in Go

namedreturn finds a named return value, you must remove it.

package a

func _()                {}              // OK
func _() int            { return 1 }    // OK
func _() (int, int)     { return 1, 1 } // OK
func _() (a int)        { return 1 }    // want "a is named return value"
func _() (a int, b int) { return 1, 1 } // want "a is named return value" "b is named return value"
func _() (a, b int)     { return 1, 1 } // want "a is named return value" "b is named return value"

Installation

go install github.com/thara/namedreturn/cmd/namedreturn@latest

Usage

go vet -vettool=$(which namedreturn) ./...

Author

Tomochika Hara (a.k.a thara)

Owner
Tomochika Hara
Software Developer, Virtual Platform Backend
Tomochika Hara
Similar Resources

Robust & Easy to use struct mapper and utility methods for Go

go-model Robust & Easy to use model mapper and utility methods for Go struct. Typical methods increase productivity and make Go development more fun ?

Dec 30, 2022

🚀 Use Lanyard API easily in your Go app!

🚀 Go Lanyard Use Lanyard API easily in your Go app! 📦 Installation Initialize your project (go mod init example.com/example) Add package (go get git

Mar 11, 2022

Go linter to check the struct literal to use field name

Structfield Find struct literals using non-labeled fields. The structfield analysis reports the usage of struct literal using non-labeled fields more

Aug 23, 2021

Infrastructure supporting the use of Go in Microsoft

Microsoft Go Infrastructure This repository contains libraries and utilities that Microsoft uses to: Build Go inside Microsoft infrastructure using up

Dec 15, 2022

Use controllers with the Gorilla Mux library

Gorilla Controllers Use controllers with the Gorilla Mux library Why controllers? Gorilla's mux library is a brilliant fully featured mux tool, Gorill

Nov 22, 2022

Easy to use, light enough, good performance Golang library

 Easy to use, light enough, good performance Golang library

指令使用 特性 简单易用、足够轻量,避免过多的外部依赖,最低兼容 Window 7 等老系统 快速上手 安装 $ go get github.com/sohaha/zlsgo HTTP 服务 // main.go

Dec 29, 2022

To run a .go file use below syntax

To run a .go file use below syntax

Nov 2, 2021

A very simplified Mux focused for ease of use.

hyper-mux A very simplified Mux focused for ease of use. go get github.com/hyperjumptech/hyper-mux How to use the Mux The following is how you going t

Aug 23, 2022

code that I re-use among many Go projects

A bunch of Go packages that I use in multiple projects. An overview of packages: u : utility functions that I use all the time. Very short package nam

Dec 30, 2022
Related tags
Vex is a variable-length, lexicographically-sortable hex format for uint64 values

Vex is a variable-length, lexicographically-sortable hex format for uint64 values. It can be used instead of fmt.Sprintf("%016x", v) for shorter s

Mar 3, 2022
Go library for decoding generic map values into native Go structures and vice versa.

mapstructure mapstructure is a Go library for decoding generic map values to structures and vice versa, while providing helpful error handling. This l

Dec 28, 2022
reasonable handling of nullable values

null import "gopkg.in/guregu/null.v4" null is a library with reasonable options for dealing with nullable SQL and JSON values There are two packages:

Dec 28, 2022
Hex dump and read values of files quickly and swiftly with Go-Hex a program designed to dump any file in a hexadecimal format

Go-Hex Hex dump and read values of files quickly and swiftly with Go-Hex a program designed to dump any file in a hexadecimal format Dump Hashes ----

Oct 10, 2021
Access and modify property values in deeply nested maps, using dot-separated paths

Dig lets you access and modify property values in deeply nested, unstructured maps, using dot-separated paths: source := make(map[string]interface{})

May 7, 2022
流媒体NetFlix解锁检测脚本 / A script used to determine whether your network can watch native Netflix movies or not
流媒体NetFlix解锁检测脚本 / A script used to determine whether your network can watch native Netflix movies or not

netflix-verify 流媒体NetFlix解锁检测脚本,使用Go语言编写 在VPS网络正常的情况下,哪怕是双栈网络也可在几秒内快速完成IPv4/IPv6的解锁判断 鸣谢 感谢 @CoiaPrant 指出对于地域检测更简便的方法 感谢 @XmJwit 解决了IPV6 Only VPS无法下载脚

Dec 29, 2022
tenv detects environment variable not using t.Setenv
tenv detects environment  variable not using t.Setenv

tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17

Nov 8, 2022
Fast, lightweight and NOT reliable tool for downloading tons of images.

image-download-tool Fast, lightweight and NOT reliable tool for downloading tons of images. How to use Run .exe with --help flag Create json file with

May 12, 2022
Helpers for making the use of reflection easier

go-xray This is a Golang library with reflection related functions which I use in my different projects. KeyValue This type is used to construct a key

Oct 24, 2022
Use Golang to implement PHP's common built-in functions.

PHP2Go Use Golang to implement PHP's common built-in functions. About 140+ functions have been implemented. Install go get github.com/syyongx/php2go R

Dec 28, 2022