mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-18 12:42:58 -06:00
1e1dcfd95a
Any time a new state is written, the current terraform version should be recorded.
18 lines
382 B
Go
18 lines
382 B
Go
package statefile
|
|
|
|
import (
|
|
"io"
|
|
|
|
tfversion "github.com/hashicorp/terraform/version"
|
|
)
|
|
|
|
// Write writes the given state to the given writer in the current state
|
|
// serialization format.
|
|
func Write(s *File, w io.Writer) error {
|
|
// Always record the current terraform version in the state.
|
|
s.TerraformVersion = tfversion.SemVer
|
|
|
|
diags := writeStateV4(s, w)
|
|
return diags.Err()
|
|
}
|