-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schema: plumb TF version generator via go generate
- Loading branch information
1 parent
669a0d7
commit 86bd319
Showing
4 changed files
with
330 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
package schema | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/hashicorp/go-version" | ||
) | ||
|
||
type coreSchemaRequiredErr struct{} | ||
|
||
func (e coreSchemaRequiredErr) Error() string { | ||
return "core schema required (none provided)" | ||
} | ||
|
||
type NoCompatibleSchemaErr struct { | ||
Version *version.Version | ||
Constraints version.Constraints | ||
} | ||
|
||
func (e NoCompatibleSchemaErr) Error() string { | ||
if e.Version != nil { | ||
return fmt.Sprintf("no compatible schema found for %s", e.Version) | ||
} | ||
if e.Constraints != nil && len(e.Constraints) > 0 { | ||
return fmt.Sprintf("no compatible schema found for %s", e.Constraints) | ||
} | ||
return "no compatible schema found" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.