trim

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

light: ceiling50: {
	room:          "MasterBedroom"
	brightnessOff: 0.0    // this line
	brightnessOn:  100.0  // and this line will be removed
}

Results in:

light: [string]: {
	room:          string
	brightnessOff: *0.0 | >=0 & <=100.0
	brightnessOn:  *100.0 | >=0 & <=100.0
}

light: ceiling50: {
	room: "MasterBedroom"
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Files

func Files(files []*ast.File, inst *cue.Instance, cfg *Config) error

Files trims fields in the given files that can be implied from other fields, as can be derived from the evaluated values in inst. Trimming is done on a best-effort basis and only when the removed field is clearly implied by another field, rather than equal sibling fields.

Types

type Config

type Config struct {
	Trace bool
}

Config configures trim options.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL