This was used in our golang testing Terraform modules to read the planfile and ensure the module was setting up correct values
Example
Since then, looks like they were all moved to an internal folder which no longer allows our testing to work as internal does not let us access the functionality to read planfiles
The saved plan format has always been an implementation detail of Terraform and subject to change at any time, even in patch releases. There is no supported way to directly consume plan files from external software.
However, if you save a plan file using terraform plan -out=tfplan and then use terraform show -json tfplan you can get a JSON representation of the plan data which is a documented integration point which is subject to the Terraform v1.0 compatibility promises, and should thus remain compatible at least through the v1.x series, which currently has no explicitly-planned end date.
Terraform is an application that happens to be written in Go, rather than a Go library, so the move of all of these packages to internal was to make explicit that integrating in that way is explicitly not supported, and specifically that the version tags in the Terraform repository represent Terraform CLI release versions and not Go Module versions.