mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
This is part of a general effort to move all of Terraform's non-library package surface under internal in order to reinforce that these are for internal use within Terraform only. If you were previously importing packages under this prefix into an external codebase, you could pin to an earlier release tag as an interim solution until you've make a plan to achieve the same functionality some other way.
22 lines
397 B
Go
22 lines
397 B
Go
// +build linux darwin openbsd netbsd solaris dragonfly
|
|
|
|
package configload
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
// lookup the inode of a file on posix systems
|
|
func inode(path string) (uint64, error) {
|
|
stat, err := os.Stat(path)
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
if st, ok := stat.Sys().(*syscall.Stat_t); ok {
|
|
return st.Ino, nil
|
|
}
|
|
return 0, fmt.Errorf("could not determine file inode")
|
|
}
|