diff --git a/build.sbt b/build.sbt index c4ff4c0..91ccd2d 100644 --- a/build.sbt +++ b/build.sbt @@ -16,7 +16,7 @@ libraryDependencies ++= Seq( "org.scalatest" %% "scalatest" % "3.2.19" % Test ) -val staticcheckVersion = "2025.1.1" +val staticcheckVersion = "2026.1" dependsOn(shared) diff --git a/docs/description/SA4020.md b/docs/description/SA4020.md index cd11179..d33e8ba 100644 --- a/docs/description/SA4020.md +++ b/docs/description/SA4020.md @@ -5,7 +5,7 @@ In a type switch like the following type T struct{} func (T) Read(b []byte) (int, error) { return 0, nil } - var v interface{} = T{} + var v any = T{} switch v.(type) { case io.Reader: @@ -23,7 +23,7 @@ Another example: func (T) Read(b []byte) (int, error) { return 0, nil } func (T) Close() error { return nil } - var v interface{} = T{} + var v any = T{} switch v.(type) { case io.Reader: diff --git a/docs/description/SA4023.md b/docs/description/SA4023.md index 528fb49..c377614 100644 --- a/docs/description/SA4023.md +++ b/docs/description/SA4023.md @@ -52,7 +52,7 @@ Similar situations to those described here can arise whenever interfaces are used. Just keep in mind that if any concrete value has been stored in the interface, the interface will not be nil. For more information, see The Laws of -Reflection (https://golang.org/doc/articles/laws_of_reflection.html). +Reflection at https://golang.org/doc/articles/laws_of_reflection.html. This text has been copied from https://golang.org/doc/faq#nil_error, licensed under the Creative diff --git a/docs/description/SA9007.md b/docs/description/SA9007.md index 3a9537c..4a6b058 100644 --- a/docs/description/SA9007.md +++ b/docs/description/SA9007.md @@ -2,7 +2,7 @@ It is virtually never correct to delete system directories such as /tmp or the user's home directory. However, it can be fairly easy to -do by mistake, for example by mistakingly using os.TempDir instead +do by mistake, for example by mistakenly using os.TempDir instead of ioutil.TempDir, or by forgetting to add a suffix to the result of os.UserHomeDir. diff --git a/docs/description/ST1019.md b/docs/description/ST1019.md index cb066a2..079996b 100644 --- a/docs/description/ST1019.md +++ b/docs/description/ST1019.md @@ -8,7 +8,6 @@ bit of code is valid: "fmt" fumpt "fmt" format "fmt" - _ "fmt" ) However, this is very rarely done on purpose. Usually, it is a @@ -22,6 +21,11 @@ https://github.com/golang/go/commit/3409ce39bfd7584523b7a8c150a310cea92d879d) – if you want to allow this pattern in your code base, you're advised to disable this check. +It is acceptable to import the same package twice if one of the imports +uses the blank identifier. This is allowed in order to increase +resilience against erroneous changes when using the same package for its +side effects as well as its exported API. + Available since 2020.1 diff --git a/docs/patterns.json b/docs/patterns.json index 129ebb5..0c42727 100644 --- a/docs/patterns.json +++ b/docs/patterns.json @@ -1,6 +1,6 @@ { "name": "staticcheck", - "version": "2025.1.1", + "version": "2026.1", "patterns": [ { "patternId": "SA1000",