如何取消封送这些数据?我正在尝试提取名称,描述,版本和其他字段。但是当我打印出未封送的内容时,我得到以下内容:
索引: {Api版本:v1 条目:地图[] 发布时间:2016-10-06T16:23:20.499029981-06:00}
这是我到目前为止尝试过的。
package main
import (
"fmt"
"log"
"gopkg.in/yaml.v2"
)
const index_yaml = `apiVersion: v1
entries:
alpine:
- created: 2016-10-06T16:23:20.499814565-06:00
description: Deploy a basic Alpine Linux pod
digest: 99c76e403d752c84ead610644d4b1c2f2b453a74b921f422b9dcb8a7c8b559cd
home: https://helm.sh/helm
name: alpine
sources:
- https://github.com/helm/helm
urls:
- https://technosophos.github.io/tscharts/alpine-0.2.0.tgz
version: 0.2.0
- created: 2016-10-06T16:23:20.499543808-06:00
description: Deploy a basic Alpine Linux pod
digest: 515c58e5f79d8b2913a10cb400ebb6fa9c77fe813287afbacf1a0b897cd78727
home: https://helm.sh/helm
name: alpine
sources:
- https://github.com/helm/helm
urls:
- https://technosophos.github.io/tscharts/alpine-0.1.0.tgz
version: 0.1.0
nginx:
- created: 2016-10-06T16:23:20.499543808-06:00
description: Create a basic nginx HTTP server
digest: aaff4545f79d8b2913a10cb400ebb6fa9c77fe813287afbacf1a0b897cdffffff
home: https://helm.sh/helm
name: nginx
sources:
- https://github.com/helm/charts
urls:
- https://technosophos.github.io/tscharts/nginx-1.1.0.tgz
version: 1.1.0
generated: 2016-10-06T16:23:20.499029981-06:00`
type Entry struct {
Created string `yaml:"created"`
Description string `yaml:"created"`
Home string `yaml:"home"`
}
type Entries map[string][]Entry
type Index struct {
ApiVersion string `yaml:"apiVersion"`
Entry Entries `yaml:"entry"`
Generated string `yaml:"generated"`
}
繁星点点滴滴
杨魅力
相关分类