From c14ce6d43cf5e22e2bd44938f3f45a2761c18350 Mon Sep 17 00:00:00 2001 From: Nils Landt Date: Wed, 12 Oct 2016 11:40:13 +0200 Subject: [PATCH] Correct FlagValue interface examples in Readme (#254) `IsChanged` is actually named `HasChanged`, and the examples were missing function return declarations, so you couldn't just copy/paste it. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ae6d50f..25181df 100644 --- a/README.md +++ b/README.md @@ -277,10 +277,10 @@ Viper provides two Go interfaces to bind other flag systems if you don't use `Pf ```go type myFlag struct {} -func (f myFlag) IsChanged() { return false } -func (f myFlag) Name() { return "my-flag-name" } -func (f myFlag) ValueString() { return "my-flag-value" } -func (f myFlag) ValueType() { return "string" } +func (f myFlag) HasChanged() bool { return false } +func (f myFlag) Name() string { return "my-flag-name" } +func (f myFlag) ValueString() string { return "my-flag-value" } +func (f myFlag) ValueType() string { return "string" } ``` Once your flag implements this interface, you can simply tell Viper to bind it: