Skip to content

Add "vischeck" linter #3721

Open
Open
@leonklingele

Description

@leonklingele

Your feature request related to a problem? Please describe.

The vischeck linter ensures certain visibility rules have been adhered to.

package main

type MyStruct struct {
	Name string `visibility:"readonly"`
	Age  int    `visibility:"readonly"`
}

func main() {
	s := MyStruct{}

	s.Name = "Frank"  // misuse of readonly field: cannot assign
	_ = &s.Name       // misuse of readonly field: cannot take address
	s.Age++           // misuse of readonly field: cannot increment
}

https://github.com/johnfrankmorgan/vischeck

Describe the solution you'd like.

Describe alternatives you've considered.

Additional context.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvementlinter: newSupport new linterno decisionNo decision to fix or not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions