32)
33`
34
35func FilterIncludeAll(fi os.FileInfo) bool { 36 return true
37}
38
100 return false, nil
101}
102
103func (e *TestEnumResolver) SchemaResolver(fieldInfo shared.AttributeInfo, castName string) (*openapi3.Schema, bool) {104 switch castName {
105 case "datetime":
106 return openapi3.NewDateTimeSchema(), false
72 return true, nil
73}
74
75func (f *TestFilter) SchemaResolver(fieldInfo shared.AttributeInfo, castName string) (*openapi3.Schema, bool) { 76 switch castName {
77 case "datetime":
78 return openapi3.NewDateTimeSchema(), false
63var _ shared.FilterFieldInterface = &TestFilter{}
64var _ shared.SchemaResolverInterface = &TestFilter{}
65
66func (f *TestFilter) FilterField(ctx context.Context, fieldInfo shared.AttributeInfo) (bool, error) { 67 for _, path := range f.AllowedFields {
68 if path == fieldInfo.QueryPath() {
69 return false, nil
46 Body *someData
47}
48
49func (r *createTestUser) Handle(ctx context.Context, w http.ResponseWriter) error { 50 encoder := json.NewEncoder(w)
51 return encoder.Encode(r.Body)
52}
Unused parameters in functions or methods should be replaced with _
(underscore) or removed.
Functions or methods with unused parameters can be a symptom of unfinished
refactoring or a bug. If an unused parameter is present, it should be named _
(underscore) to avoid raising this issue and better readability.
func abc(unused string) {
fmt.Println("Not using any passed params.")
}
func abc(_ string) {
fmt.Println("Not using any passed params.")
}
func abc() {
fmt.Println("Not using any passed params.")
}