Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Feature Request: Strict and loose mode #14

Open
hummerd opened this issue Mar 25, 2021 · 0 comments
Open

Feature Request: Strict and loose mode #14

hummerd opened this issue Mar 25, 2021 · 0 comments

Comments

@hummerd
Copy link

hummerd commented Mar 25, 2021

It will be great to have option - mode: strict or loose. Strict mode is how it works now. In loose mode only check fields that is really dangerous to have not initialized. By dangerous I mean types that will cause errors on access to it:

type Some struct {
	Counter int        // it's ok not to init this (in loose mode)
	Lock    sync.Mutex // it's ok 
	Slice   []int      // it's ok 

	Map  map[int]int // it's not ok - writing to not initialized map panics
	Cond *sync.Cond  // it's not ok - access to not initialized pointer will panic
	W    io.Writer   // it's not ok - access to not initialized interface will panic
	Chan chan int    // it's not ok - writing to not initialized chan will hang
}
@hummerd hummerd changed the title Feature Request: Find fields that was never assigned Feature Request: Strict and loose mode Mar 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant