From c53279dd47becbfe921e0780864053fe3f15c2b3 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 1 Feb 2024 18:46:47 +0200 Subject: [PATCH] mockgen: remove unused support files for Go below 1.17 --- mockgen/{generic_go118.go => generic.go} | 3 -- mockgen/generic_notgo118.go | 41 ------------------------ 2 files changed, 44 deletions(-) rename mockgen/{generic_go118.go => generic.go} (98%) delete mode 100644 mockgen/generic_notgo118.go diff --git a/mockgen/generic_go118.go b/mockgen/generic.go similarity index 98% rename from mockgen/generic_go118.go rename to mockgen/generic.go index b7b4494..d425e77 100644 --- a/mockgen/generic_go118.go +++ b/mockgen/generic.go @@ -5,9 +5,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build go1.18 -// +build go1.18 - package main import ( diff --git a/mockgen/generic_notgo118.go b/mockgen/generic_notgo118.go deleted file mode 100644 index 8a779c8..0000000 --- a/mockgen/generic_notgo118.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !go1.18 -// +build !go1.18 - -package main - -import ( - "fmt" - "go/ast" - - "go.uber.org/mock/mockgen/model" -) - -func getTypeSpecTypeParams(ts *ast.TypeSpec) []*ast.Field { - return nil -} - -func (p *fileParser) parseGenericType(pkg string, typ ast.Expr, tps map[string]model.Type) (model.Type, error) { - return nil, nil -} - -func getIdentTypeParams(decl any) string { - return "" -} - -func (p *fileParser) parseGenericMethod(field *ast.Field, it *namedInterface, iface *model.Interface, pkg string, tps map[string]model.Type) ([]*model.Method, error) { - return nil, fmt.Errorf("don't know how to mock method of type %T", field.Type) -}