File tree Expand file tree Collapse file tree 2 files changed +7
-23
lines changed
Expand file tree Collapse file tree 2 files changed +7
-23
lines changed Original file line number Diff line number Diff line change 1- // Licensed to the Apache Software Foundation (ASF) under one
2- // or more contributor license agreements. See the NOTICE file
3- // distributed with this work for additional information
4- // regarding copyright ownership. The ASF licenses this file
5- // to you under the Apache License, Version 2.0 (the
6- // "License"); you may not use this file except in compliance
7- // with the License. You may obtain a copy of the License at
8- //
9- // http://www.apache.org/licenses/LICENSE-2.0
10- //
11- // Unless required by applicable law or agreed to in writing,
12- // software distributed under the License is distributed on an
13- // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14- // KIND, either express or implied. See the License for the
15- // specific language governing permissions and limitations
16- // under the License.
17-
18- package config
19-
20- var preCache = `{
1+ {
212 "api": [
223 {
234 "description": "Creates VPC offering",
@@ -172901,5 +172882,4 @@ var preCache = `{
172901172882 }
172902172883 ],
172903172884 "count": 880
172904- }`
172905-
172885+ }
Original file line number Diff line number Diff line change 1818package config
1919
2020import (
21+ _ "embed"
2122 "encoding/json"
2223 "fmt"
2324 "io/ioutil"
@@ -33,6 +34,9 @@ const (
3334 FilePathArg = "filepath="
3435)
3536
37+ //go:embed apis.json
38+ var bundledAPICache []byte
39+
3640// APIArg are the args passable to an API
3741type APIArg struct {
3842 Name string
@@ -89,7 +93,7 @@ func LoadCache(c *Config) interface{} {
8993 cache , err := ioutil .ReadFile (cacheFile )
9094 if err != nil {
9195 fmt .Fprintf (os .Stderr , "Loaded in-built API cache. Failed to read API cache, please run 'sync'.\n " )
92- cache = [] byte ( preCache )
96+ cache = bundledAPICache
9397 }
9498 var data map [string ]interface {}
9599 _ = json .Unmarshal (cache , & data )
You can’t perform that action at this time.
0 commit comments