Open balakumarsubramani opened 3 weeks ago
Declare a genrate with env
//go:generate env GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn mockgen -package=mocks -destination=../../mocks/custom_provider_mock.go authserver/session CustomProvider type CustomProvider interface { session.Provider GetExpireDate(string) (string, error) GetDecoded(string, LoggerInterface) (map[string]interface{}, error) CreateNewSession(string, LoggerInterface) (sessionstore.SessionStore, error) }
Notice the generated code is not cached
session/session_provider.go: env GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn mockgen -package=mocks -destination=../../mocks/custom_provider_mock.go authserver/session CustomProvider (generated, noplugin, 9198ms)
Generated code is cached when env is not passed to go:generate
Declare a genrate with env
Notice the generated code is not cached