Allow empty string in shadowMethod for backward compatibility.

This commit is contained in:
Chen Yufei
2013-04-15 15:33:05 +08:00
parent 061e95246c
commit e7db992baf

View File

@@ -378,8 +378,9 @@ func parseConfig(path string) {
if method == zeroMethod {
Fatalf("no such option \"%s\"\n", key)
}
if val == "" {
Fatalf("empty %s, please comment out unused option\n", key)
// allow using empty string to specify shadowMethod, just for backward compatibility
if val == "" && key != "shadowMethod" {
Fatalf("empty %s, please comment or remove unused option\n", key)
}
args := []reflect.Value{reflect.ValueOf(val)}
method.Call(args)