kcl-lang/kcl-go

[Bug] Unexpected Import data format for YAML

Closed this issue · 1 comments

Peefy commented

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Import the following YAML to KCL

# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
  hooks:
    # You may remove this if you don't use go modules.
    - go mod tidy

# .goreleaser.yml
builds:
  - id: "kcl"
    main: ./kcl.go
    goos:
      - darwin
      - linux
      - windows
    goarch:
      - amd64
      - arm64
    env:
      - CGO_ENABLED=0
    ldflags:
      - "-X kcl-lang.io/cli/pkg/version.version={{.Version}}"

2. What did you expect to see? (Required)

"""
This file was generated by the KCL auto-gen tool. DO NOT EDIT.
Editing this file might prove futile when you re-run the KCL auto-gen generate command.
"""

before = {
    hooks = [
        "go mod tidy"
    ]
}
builds = [
    {
        id = "kcl"
        main = "./kcl.go"
        goos = [
            "darwin"
            "linux"
            "windows"
        ]
        goarch = [
            "amd64"
            "arm64"
        ]
        env = [
            "CGO_ENABLED=0"
        ]
        ldflags = [
            "-X kcl-lang.io/cli/pkg/version.version={{.Version}}"
        ]
    }
]

3. What did you see instead (Required)

"""
This file was generated by the KCL auto-gen tool. DO NOT EDIT.
Editing this file might prove futile when you re-run the KCL auto-gen generate command.
"""

before = {
    hooks = [
        "go mod tidy"]
}
builds = [
    {
        id = "kcl"
        main = "./kcl.go"
        goos = [
            "darwin"    "linux"    "windows"]
        goarch = [
            "amd64"    "arm64"]
        env = [
            "CGO_ENABLED=0"]
        ldflags = [
            "-X kcl-lang.io/cli/pkg/version.version={{.Version}}"]
    }
]

4. What is your KCL components version? (Required)

kcl-go v0.6.1