@@ -30,6 +30,7 @@ type visibilityStruct struct {
3030}
3131
3232var fullVisibility * visibilityStruct = & visibilityStruct {true , true , true }
33+ var telemetryOnly * visibilityStruct = & visibilityStruct {false , false , true }
3334
3435type locationStruct struct {
3536 File string `json:"file,omitempty"`
@@ -192,3 +193,80 @@ func EmitRelativeImportPaths() {
192193 noLocation ,
193194 )
194195}
196+
197+ func EmitUnsupportedVersionGoMod (msg string ) {
198+ emitDiagnostic (
199+ "go/identify-environment/unsupported-version-in-go-mod" ,
200+ "Unsupported Go version in `go.mod` file" ,
201+ msg ,
202+ severityError ,
203+ telemetryOnly ,
204+ noLocation ,
205+ )
206+ }
207+
208+ func EmitUnsupportedVersionEnvironment (msg string ) {
209+ emitDiagnostic (
210+ "go/identify-environment/unsupported-version-in-environment" ,
211+ "Unsupported Go version in environment" ,
212+ msg ,
213+ severityError ,
214+ telemetryOnly ,
215+ noLocation ,
216+ )
217+ }
218+
219+ func EmitNoGoModAndNoGoEnv (msg string ) {
220+ emitDiagnostic (
221+ "go/identify-environment/no-go-mod-and-no-go-env" ,
222+ "No `go.mod` file found and no Go version in environment" ,
223+ msg ,
224+ severityNote ,
225+ telemetryOnly ,
226+ noLocation ,
227+ )
228+ }
229+
230+ func EmitNoGoEnv (msg string ) {
231+ emitDiagnostic (
232+ "go/identify-environment/no-go-mod-and-no-go-env" ,
233+ "No Go version in environment" ,
234+ msg ,
235+ severityNote ,
236+ telemetryOnly ,
237+ noLocation ,
238+ )
239+ }
240+
241+ func EmitNoGoMod (msg string ) {
242+ emitDiagnostic (
243+ "go/identify-environment/no-go-mod" ,
244+ "No `go.mod` file found" ,
245+ msg ,
246+ severityNote ,
247+ telemetryOnly ,
248+ noLocation ,
249+ )
250+ }
251+
252+ func EmitVersionGoModHigherVersionEnvironment (msg string ) {
253+ emitDiagnostic (
254+ "go/identify-environment/version-go-mod-higher-than-go-env" ,
255+ "The Go version in `go.mod` file is higher than the Go version in environment" ,
256+ msg ,
257+ severityWarning ,
258+ telemetryOnly ,
259+ noLocation ,
260+ )
261+ }
262+
263+ func EmitVersionGoModNotHigherVersionEnvironment (msg string ) {
264+ emitDiagnostic (
265+ "go/identify-environment/version-go-mod-not-higher-than-go-env" ,
266+ "The Go version in `go.mod` file is not higher than the Go version in environment" ,
267+ msg ,
268+ severityNote ,
269+ telemetryOnly ,
270+ noLocation ,
271+ )
272+ }
0 commit comments