GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fsamin/nofuncflags: a Go(lang) linter, because flag arguments are ugly

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
doc
doc
 
 
fixtures
fixtures
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
main.go
main.go
 
 
nofuncflags.go
nofuncflags.go
 
 
nofuncflags_test.go
nofuncflags_test.go
 
 

Repository files navigation

Golang nofuncflags linter

« Flag arguments are ugly. Passing a boolean into a function is a truly terrible practice. It immediately complicates the signature of the method, loudly proclaiming that this function does more than one thing. It does one thing if the flag is true and another if the flag is false! »

Clean Code - Robert C. Martin

VSC Preview

Installation

go get github.com/fsamin/nofuncflags

Usage

Any funcions containing a boolean as argument are extracted.

nofuncflags [<path>...]

Usage with gometalinter

gometalinter --linter=nofuncflags:nofuncflags:PATH:LINE:COL:MESSAGE --enable=nofuncflags [<flags>] [<path>...]

Usage with Visual Studio Code To use nofuncflags with VS Code you need to have Go Meta Linter installed, then add following to your User Settings (Ctrl+,)

"go.lintTool": "gometalinter",
"go.lintFlags": [
  "--disable-all", // Disable all linters
  "--linter=nofuncflags:nofuncflags:PATH:LINE:COL:MESSAGE",
  "--enable=nofuncflags",
  "--enable=golint", // Enable any other linters you want to use
],

About

a Go(lang) linter, because flag arguments are ugly

Topics

gogolanggometalinterlinter

Resources

Readme
Apache-2.0 license
Activity

Stars

8 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.