Skip to content

Commit

Permalink
cue: add LanguageVersion
Browse files Browse the repository at this point in the history
This makes the current language version available as part of the public
API.

Currently there is no way in the public API to obtain access to the
current language version as defined in `cueversion.LanguageVersion`.

When users of the Go API are wanting to create a module.cue version
manually that corresponds to the current language version, that would be
useful.

Fixes #3246.

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Iac7e185c1ec8090dcf9da6a09bb8b4f09f10ead8
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196820
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Paul Jolly <paul@myitcv.io>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
  • Loading branch information
rogpeppe committed Jul 1, 2024
1 parent 6594f45 commit a9009e8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cue/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2024 The CUE 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 cue

import "cuelang.org/go/internal/cueversion"

// LanguageVersion returns the CUE language version.
// This determines the latest version of CUE that
// is understood by the evaluator and module code.
func LanguageVersion() string {
return cueversion.LanguageVersion()
}

0 comments on commit a9009e8

Please sign in to comment.