Skip to content

Commit

Permalink
golintci
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Login <[email protected]>
  • Loading branch information
batazor committed Nov 12, 2023
1 parent a9ddd9c commit 0d370f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions internal/pkg/protoc/protoc-gen-go-orm/go_orm.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func main() {
// Generate ORM
generateFile(gen, f)
}

return nil
})
}
Expand All @@ -44,6 +45,7 @@ func protocVersion(gen *protogen.Plugin) string {
if s := v.GetSuffix(); s != "" {
suffix = "-" + s
}

return fmt.Sprintf("v%d.%d.%d%s", v.GetMajor(), v.GetMinor(), v.GetPatch(), suffix)
}

Expand Down
12 changes: 6 additions & 6 deletions internal/pkg/protoc/protoc-gen-go-orm/go_orm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestFilterLink_BuildFilter(t *testing.T) {
name string
filter fixtures.FilterLink
expectedSQL string
expectedArgs []interface{}
expectedArgs []any
}{
{
name: "Equal and Contains",
Expand All @@ -55,7 +55,7 @@ func TestFilterLink_BuildFilter(t *testing.T) {
Describe: &fixtures.StringFilterInput{Contains: "test"},
},
expectedSQL: "SELECT * FROM links WHERE url = ? AND describe LIKE '%' || ?",
expectedArgs: []interface{}{"https://example.com", "test"},
expectedArgs: []any{"https://example.com", "test"},
},
{
name: "Not Equal and Starts With",
Expand All @@ -64,7 +64,7 @@ func TestFilterLink_BuildFilter(t *testing.T) {
Describe: &fixtures.StringFilterInput{StartsWith: "start"},
},
expectedSQL: "SELECT * FROM links WHERE url <> ? AND describe LIKE '%' || ?",
expectedArgs: []interface{}{"https://example.org", "start"},
expectedArgs: []any{"https://example.org", "start"},
},
{
name: "Greater Than and Ends With",
Expand All @@ -73,7 +73,7 @@ func TestFilterLink_BuildFilter(t *testing.T) {
Describe: &fixtures.StringFilterInput{EndsWith: "end"},
},
expectedSQL: "SELECT * FROM links WHERE url > ? AND describe LIKE ? || '%'",
expectedArgs: []interface{}{"https://example.com/a", "end"},
expectedArgs: []any{"https://example.com/a", "end"},
},
{
name: "Less Than and Is Empty",
Expand All @@ -82,7 +82,7 @@ func TestFilterLink_BuildFilter(t *testing.T) {
Describe: &fixtures.StringFilterInput{IsEmpty: true},
},
expectedSQL: "SELECT * FROM links WHERE url < ? AND describe = '' OR describe IS NULL",
expectedArgs: []interface{}{"https://example.com/z"},
expectedArgs: []any{"https://example.com/z"},
},
{
name: "Complex - Multiple Conditions",
Expand All @@ -101,7 +101,7 @@ func TestFilterLink_BuildFilter(t *testing.T) {
},
expectedSQL: "SELECT * FROM links WHERE url <> ? AND url LIKE '%' || ? AND url LIKE ? || '%' AND " +
"describe < ? AND describe > ? AND describe LIKE '%' || ? AND describe NOT LIKE ?",
expectedArgs: []interface{}{
expectedArgs: []any{
"https://example.org", "https", ".com",
"m", "a", "test", "example", // Adjusted to match actual behavior
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (l *Link) Get(ctx context.Context, in *GetRequest) (*GetResponse, error) {
func (l *Link) List(ctx context.Context, in *ListRequest) (*ListResponse, error) {
// Parse args
filter := v1.FilterLink{
Url: &v1.StringFilterInput{Contains: in.Filter},
Url: &v1.StringFilterInput{Contains: in.GetFilter()},
}

resp, err := l.service.List(ctx, &filter)
Expand Down

0 comments on commit 0d370f5

Please sign in to comment.