Huge news!Announcing our $20M Series A led by Andreessen Horowitz.Learn more
Socket
Socket
Log inDemoInstall

4d63.com/gochecknoinits

Package Overview
Dependencies
0
Maintainers
0
Issues
File Explorer

4d63.com/gochecknoinits

    v0.0.0-20210416043744-25bb07f6e4e3

Version published
Maintainers
0

Readme

gochecknoinits

Build Status Go Report Card

Check that no inits functions are present in Go code.

Why

Init functions cause an import to have side effects, and side effects are hard to test, reduce readability and increase the complexity of code.

https://peter.bourgon.org/blog/2017/06/09/theory-of-modern-go.html https://twitter.com/davecheney/status/871939730761547776

Install

go get 4d63.com/gochecknoinits

Usage

gochecknoinits
gochecknoinits ./...
gochecknoinits [path] [path] [path] [etc]

Add -t to include tests.

gochecknoinits -t [path]

Note: Paths are only inspected recursively if the Go /... recursive path suffix is appended to the path.

FAQs

Last updated on 16 Apr 2021

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install
SocketSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc