From 6408504b3f39084e48796a105dcb57013377ead9 Mon Sep 17 00:00:00 2001 From: linweiyuan Date: Fri, 9 Sep 2022 00:27:06 +0800 Subject: [PATCH] fix: support version 2 in error message --- internal/cmd/generate.go | 4 ++-- internal/config/config.go | 15 --------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/internal/cmd/generate.go b/internal/cmd/generate.go index 82756b2254..03cb8e6365 100644 --- a/internal/cmd/generate.go +++ b/internal/cmd/generate.go @@ -27,7 +27,7 @@ import ( ) const errMessageNoVersion = `The configuration file must have a version number. -Set the version to 1 at the top of sqlc.json: +Set the version to 1 or 2 at the top of sqlc.json: { "version": "1" @@ -36,7 +36,7 @@ Set the version to 1 at the top of sqlc.json: ` const errMessageUnknownVersion = `The configuration file has an invalid version number. -The only supported version is "1". +The supported version can only be "1" or "2". ` const errMessageNoPackages = `No packages are configured` diff --git a/internal/config/config.go b/internal/config/config.go index 0b1aea64ef..7335bb0b2c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -10,21 +10,6 @@ import ( yaml "gopkg.in/yaml.v3" ) -const errMessageNoVersion = `The configuration file must have a version number. -Set the version to 1 at the top of sqlc.json: - -{ - "version": "1" - ... -} -` - -const errMessageUnknownVersion = `The configuration file has an invalid version number. -The only supported version is "1". -` - -const errMessageNoPackages = `No packages are configured` - type versionSetting struct { Number string `json:"version" yaml:"version"` }