Skip to content

CHANGELOG

Nishanth Shanmugham edited this page Nov 11, 2023 · 57 revisions

The version numbers have no special meaning.

v0.12.0

  • Add new flag -default-case-required and related directive comments; see 13ee94a.
  • Upgrade golang.org/x/tools dependency.

v0.11.0

  • go.mod specifies go 1.18.
  • Upgrade golang.org/x/tools dependency.

v0.10.0

  • More consistent handling for type parameters.
  • Documentation improvements.

v0.9.5

Documentation.

v0.9.4

  • Upgrade golang.org/x/tools dependency to v0.4.0.
  • Documentation.
  • Internal: add tests.

v0.9.3

  • Account for anonymous interfaces in type parameters; see 920609b.
  • Documentation.
  • Internal: faster test runs; see 9b7ddfe.

v0.9.2

Documentation.

v0.9.1

Add the -ignore-enum-types flag. For details see commit 176c4b3. The flag documentation is below. See package comment for details.

-ignore-enum-types regexp
  types matching regexp are ignored for exhaustiveness checks

v0.9.0

  • Add support for checking exhaustiveness for values whose type is a type parameter. See issue 31 and commit f71d526.
  • Type conversions in case clause expressions no longer produce a false positive diagnostic. See issue 42 and commit f71d526.
  • The diagnostic message now always includes the package name for members names, even if the symbol is in the same package as the offending line. For rationale, see commit message for f71d526.
  • The diagnostic message prefix for missing map keys has been edited for clarity.
  • Upgrade golang.org/x/tools dependency to v0.3.0.
  • Switch links from godocs.io to pkg.go.dev.

v0.8.3

Documentation.

v0.8.2

  • Add support for checking map literals. Specify -check=switch,map to check map literals for exhaustiveness, in addition to switch statements. The majority of the work is in commit fad1089.
  • Add the -check flag, which specifies the program elements (e.g. switch statements, map literals) that should be checked. The default value is "switch".
  • The diagnostic message lists missing member names in AST order instead of lexicographical order. For details see issue 41.

v0.8.1

v0.8.0 was accidentally tagged in a non-master branch. v0.8.1, which is effectively the same as v0.8.0, has been tagged correctly on master.

v0.8.0

  • exhaustive now strictly follows the go/ast definition for associated comments for switch statements. Previously, comments like the one below would have been associated with the switch statement.
    switch x { //exhaustive:ignore
    
    Now the comment must be moved like so to have effect:
    //exhaustive:ignore
    switch x {
    
  • Add the -explicit-exhaustive-switch flag. The description for the flag is: run exhaustive check on switch statements only if it associated with a "//exhaustive:enforce" comment.
  • Fix issue 37. Previously, due to a bug in the comment association logic, exhaustive would have inadvertently missed to check nested switch statements if a parent switch statement was marked "//exhaustive:ignore". This has been fixed such that the nested switch statement is now checked. (To ignore the nested switch statement, you should explicitly mark it with "//exhaustive:ignore".)
  • Upgrade golang.org/x/tools dependency.

v0.7.11

  • Documentation changes.
  • Switch links from pkg.go.dev to godocs.io.

v0.7.10

Documentation.

v0.7.9

Documentation.

v0.7.8

Documentation.

v0.7.7

Documentation.

v0.7.6

Documentation.

v0.7.5

Documentation.

v0.7.4

Fix detection of generated files. Account for the requirement:

This line must appear before the first non-comment, non-blank text in the file.

https://golang.org/s/generatedcode

v0.7.3

  • Dot-imported package constants in case clauses work correctly; previously they would be incorrectly reported as missing in the switch.
  • Improve support for same-valued type alias constants.

v0.7.2

The IgnoreDirectivePrefix constant is no longer exported. (Its behavior still remains the same.)

v0.7.1

Fix the PackageScopeOnly constant name: it is renamed to PackageScopeOnlyFlag to be consistent with the other similar constant names in the package.

v0.7.0

  • Address issue 13. The package now checks exhaustiveness of type aliased enums. The related documentation is available in the package comment in file doc.go or can be found on the pkg.go.dev page, under the new section 'Exhaustiveness and type aliases'.

v0.6.0

  • Fix issue 23. Same-named enum types in package scope and in inner scope could previously produce an incorrect diagnostic.
  • Address issue 11. The analyzer can now find enums defined in non-package scopes (e.g. inside a function body). Switch statements using non-package scoped enums can now be checked for exhaustiveness.
  • The new flag -package-scope-only controls the behavior described in the previous item. If enabled, only package-scoped enums are detected. The flag is off by default, which means that enums in inner scopes will also be found. If you encounter an issue with the new behavior, use -package-scope-only=false and create an issue.
  • Documentation changes.

v0.5.0

  • Flag -checking-strategy is deprecated and has no effect. The default checking strategy "value" is the strategy in use and is the only available strategy.
  • Internally, the analyzer assumes that constant values can always be determined for enum members. This should be a valid assumption because only const declarations can be enum members.

v0.4.0

  • var declarations cannot be enum members; only const can be.

v0.3.7

  • Previously the analzyer incorrectly determined constant values for enum members; this has been fixed. This is noticeable in e.g. constants defined using iota.
  • Previously the analzyer failed to determine constant values for enum members when it actually could have; this has been fixed. This is most noticable for constants defined using iota.

v0.3.6

  • If pass.ImportPackageFact fails, it is now reported as a diagnostic via pass.Report. Previously, this would have resulted in a returned error from the Analzyer's Run function.
  • Upgrade golang.org/x/tools dependency.

v0.3.5

Fixed a bug in detection of generated files; the following comment was incorrectly detected as indicative of a generated file.

// Code generated DO NOT EDIT.

v0.3.4

Documentation.

v0.3.3

Documentation.

v0.3.2

Documentation.

v0.3.1

Documentation.

v0.3.0

  • The flag -ignore-pattern has no effect and is deprecated. Instead see the new flag -ignore-enum-members, which has the same syntax and behavior.
  • A new -checking-strategy flag has been added; see package documentation for details.
  • The analyzer no longer suggests fixes.

Earlier tags

(No changelog available.)