commit | e8ec36e6e91bab717edc73211f9e289d2e2d4764 | [log] [tgz] |
---|---|---|
author | Todd Wang <toddw@google.com> | Fri Oct 16 09:37:35 2015 -0700 |
committer | Todd Wang <toddw@google.com> | Fri Oct 16 09:37:35 2015 -0700 |
tree | 5f5f68dc77479666cf648a7785c78f339228a867 | |
parent | 69794dd99076ce09aee024565df9640499d0deff [diff] |
lib: Remove TODO comment regarding -metadata flag. The intended usage of the -metadata flag is that whenever it is set on the command-line, the program will dump metadata to stdout and gracefully terminate. Originally I had planned to implement this by making the Set method return a metadata.ErrFlag error. This way the caller of FlagSet.Parse could check the error against metadata.ErrFlag, and do whatever they liked. However there was a bug in the flag package that ignored errors returned by Set for boolean flags. That's been fixed: https://github.com/golang/go/commit/bc611a31a5b3003ba6c05d337093f9b83e898209 But there's still a catch. The flag package wraps the errors returned by Set with its own error. That means the caller of FlagSet.Parse cannot distinguish the error based on its type or value. So I'm giving up and getting rid of the TODO. Calling os.Exit(0) is ugly, but is fine for all practical purposes. Change-Id: Id04d3b3d6564327156f9e6c5dbd9301598c161a7
This repository contains general purpose libraries used by the Vanadium project. TEST