Fix dependencies
This commit is contained in:
		
							
								
								
									
										15
									
								
								vendor/github.com/googleapis/gnostic/compiler/error.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								vendor/github.com/googleapis/gnostic/compiler/error.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -1,4 +1,4 @@ | ||||
| // Copyright 2017 Google LLC. All Rights Reserved. | ||||
| // Copyright 2017 Google Inc. All Rights Reserved. | ||||
| // | ||||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| // you may not use this file except in compliance with the License. | ||||
| @ -14,8 +14,6 @@ | ||||
|  | ||||
| package compiler | ||||
|  | ||||
| import "fmt" | ||||
|  | ||||
| // Error represents compiler errors and their location in the document. | ||||
| type Error struct { | ||||
| 	Context *Context | ||||
| @ -27,19 +25,12 @@ func NewError(context *Context, message string) *Error { | ||||
| 	return &Error{Context: context, Message: message} | ||||
| } | ||||
|  | ||||
| func (err *Error) locationDescription() string { | ||||
| 	if err.Context.Node != nil { | ||||
| 		return fmt.Sprintf("[%d,%d] %s", err.Context.Node.Line, err.Context.Node.Column, err.Context.Description()) | ||||
| 	} | ||||
| 	return err.Context.Description() | ||||
| } | ||||
|  | ||||
| // Error returns the string value of an Error. | ||||
| func (err *Error) Error() string { | ||||
| 	if err.Context == nil { | ||||
| 		return err.Message | ||||
| 		return "ERROR " + err.Message | ||||
| 	} | ||||
| 	return err.locationDescription() + " " + err.Message | ||||
| 	return "ERROR " + err.Context.Description() + " " + err.Message | ||||
| } | ||||
|  | ||||
| // ErrorGroup is a container for groups of Error values. | ||||
|  | ||||
		Reference in New Issue
	
	Block a user