Skip to content

Commit

Permalink
Change where the version number is stored
Browse files Browse the repository at this point in the history
  • Loading branch information
SHENCaesar committed Jun 7, 2024
1 parent 9b66a80 commit bca63c2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
7 changes: 4 additions & 3 deletions pkg/argparse/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/kitex-contrib/kitexcall/pkg/config"
"github.com/kitex-contrib/kitexcall/pkg/errors"
"github.com/kitex-contrib/kitexcall/pkg/log"
"github.com/kitex-contrib/kitexcall/pkg/versions"
)

type Argument struct {
Expand Down Expand Up @@ -129,8 +130,8 @@ func (a *Argument) ParseArgs() error {
a.PreJudge(f)

if a.Version {
fmt.Printf("kitexcall version %s\n", config.Version)
os.Exit(0)
fmt.Printf("kitexcall version %s\n", versions.Version)
os.Exit(0)
}

log.Verbose = a.Verbose
Expand Down Expand Up @@ -277,7 +278,7 @@ func (a *Argument) BuildConfig() *config.Config {
MetaPersistent: a.MetaPersistent,
MetaBackward: a.MetaBackward,
BizError: a.BizError,
Version: a.Version,
Version: a.Version,
}
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ const (
TTHeaderFramed string = "TTHeaderFramed"
)

//kitexcall version
const (
Version string = "0.1.1"
)

// We provide a general configuration
// so that it can be utilized by others apart from kitexcall.
type Config struct {
Expand Down
23 changes: 23 additions & 0 deletions pkg/versions/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2021 CloudWeGo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package versions

// Name and Version info of this framework, used for statistics and debug
const (
Name = "Kitexcall"
Version = "v0.1.1"
)

0 comments on commit bca63c2

Please sign in to comment.