diff --git a/README.md b/README.md index a75bb93..b9c0e09 100644 --- a/README.md +++ b/README.md @@ -193,7 +193,8 @@ func main() { ## Contributing Contributions in the form of pull requests, issues or just general feedback, -are always welcome. See [CONTRIBUTING.MD](CONTRIBUTING.md). +are always welcome. +See [CONTRIBUTING.MD](CONTRIBUTING.md). **Contributors**: [adrg](https://github.com/adrg), diff --git a/example_test.go b/example_test.go index 38c1c20..105fef7 100644 --- a/example_test.go +++ b/example_test.go @@ -42,6 +42,15 @@ func ExampleRuntimeFile() { fmt.Println("Save runtime file at:", runtimeFilePath) } +func ExampleStateFile() { + stateFilePath, err := xdg.DataFile("appname/app.state") + if err != nil { + // Treat error. + } + + fmt.Println("Save state file at:", stateFilePath) +} + func ExampleSearchDataFile() { dataFilePath, err := xdg.SearchDataFile("appname/app.data") if err != nil { @@ -77,3 +86,12 @@ func ExampleSearchRuntimeFile() { fmt.Println("The runtime file was found at:", runtimeFilePath) } + +func ExampleSearchStateFile() { + stateFilePath, err := xdg.SearchStateFile("appname/app.state") + if err != nil { + // The state file could not be found. + } + + fmt.Println("The state file was found at:", stateFilePath) +}