mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-04 07:49:35 +00:00 
			
		
		
		
	Format json file with proper indentation
Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
		@@ -17,6 +17,7 @@ limitations under the License.
 | 
				
			|||||||
package benchmark
 | 
					package benchmark
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"bytes"
 | 
				
			||||||
	"context"
 | 
						"context"
 | 
				
			||||||
	"encoding/json"
 | 
						"encoding/json"
 | 
				
			||||||
	"flag"
 | 
						"flag"
 | 
				
			||||||
@@ -173,8 +174,11 @@ func dataItems2JSONFile(dataItems DataItems, namePrefix string) error {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		destFile = path.Join(*dataItemsDir, destFile)
 | 
							destFile = path.Join(*dataItemsDir, destFile)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						formatted := &bytes.Buffer{}
 | 
				
			||||||
	return ioutil.WriteFile(destFile, b, 0644)
 | 
						if err := json.Indent(formatted, b, "", "  "); err != nil {
 | 
				
			||||||
 | 
							return fmt.Errorf("indenting error: %v", err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return ioutil.WriteFile(destFile, formatted.Bytes(), 0644)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type labelValues struct {
 | 
					type labelValues struct {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user