code: func Marshal(sf *statefile.File, schemas *terraform.Schemas) ([]byte, error) {
  	output := newState()
  
  	if sf == nil || sf.State.Empty() {
  		ret, err := json.Marshal(output)
  		return ret, err
  	}
  
  	if sf.TerraformVersion != nil {
  		output.TerraformVersion = sf.TerraformVersion.String()
  	}
  
  	// output.StateValues
  	err := output.marshalStateValues(sf.State, schemas)
  	if err != nil {
  		return nil, err
  	}
  
  	ret, err := json.Marshal(output)
  	return ret, err
  }
docs: // Marshal returns the json encoding of a terraform state.