You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
v1alpha1 "knative.dev/serving/pkg/apis/autoscaling/v1alpha1" // want `import"knative.dev/serving/pkg/apis/autoscaling/v1alpha1" imported as "v1alpha1" but must be "autoscalingv1alpha1" according to config`
3131
+
v1 "knative.dev/serving/pkg/apis/serving/v1" // want `import"knative.dev/serving/pkg/apis/serving/v1" imported as "v1" but must be "servingv1" according to config`
3132
+
)
3133
+
3134
+
func main() {
3135
+
...
3136
+
```
3137
+
3138
+
Requirements
3139
+
```
3140
+
go install github.com/julz/importas/cmd/importas@latest
3141
+
```
3142
+
3116
3143
### [⏫](#contents)➡ Detect naked returns with [nakedret](https://github.com/alexkohler/nakedret)
3117
3144
3118
3145
It is common guideline to avoid [naked returns](https://github.com/golang/go/wiki/CodeReviewComments#named-result-parameters). Naked return is when function has named return, and return statement does not specify value. This tool is useful for investigations. — [@alexkohler](https://github.com/alexkohler)
Copy file name to clipboardExpand all lines: page.yaml
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2118,6 +2118,26 @@ groups:
2118
2118
pkg/apis/apps/v1beta1/zz_generated.conversion.go:31 unnecessary import alias runtime
2119
2119
requirements:
2120
2120
- go install github.com/alexkohler/unimport@latest
2121
+
- title: Detect unexpected import aliases
2122
+
description: Ensure that import aliases take one of the allowed values.
2123
+
url: https://github.com/julz/importas
2124
+
name: importas
2125
+
author: https://github.com/julz
2126
+
example_content_ext: go
2127
+
example_content: |
2128
+
package main
2129
+
2130
+
import (
2131
+
v1alpha1 "knative.dev/serving/pkg/apis/autoscaling/v1alpha1" // want `import "knative.dev/serving/pkg/apis/autoscaling/v1alpha1" imported as "v1alpha1" but must be "autoscalingv1alpha1" according to config`
2132
+
v1 "knative.dev/serving/pkg/apis/serving/v1" // want `import "knative.dev/serving/pkg/apis/serving/v1" imported as "v1" but must be "servingv1" according to config`
- go install github.com/julz/importas/cmd/importas@latest
2121
2141
- title: Detect naked returns
2122
2142
description: "It is common guideline to avoid [naked returns](https://github.com/golang/go/wiki/CodeReviewComments#named-result-parameters). Naked return is when function has named return, and return statement does not specify value. This tool is useful for investigations."
0 commit comments