services/device/device: refactor {instance|installation}StateFlag with 'generic'

Since Go doesn't support generics, we define an interface to wrap InstanceState and InstallationState and most of the previously duplicated code now operates on a set of such interface instances.

We come out about even in terms of code, but the benefits of the refactoring
will become more apparent once I add more logic (for implementing exclusion of
states).

Change-Id: I689fbb5b4e15efc6efd90e2a03cd8ba779d14111
2 files changed
tree: bbe9e86f654f7632a428c05e0cdde39de8c8a90f
  1. cmd/
  2. examples/
  3. internal/
  4. lib/
  5. runtime/
  6. services/
  7. test/
  8. .gitignore
  9. AUTHORS
  10. CONTRIBUTORS
  11. envvar.go
  12. envvar_test.go
  13. LICENSE
  14. PATENTS
  15. README.md
  16. VERSION
README.md

Vanadium

This repository contains a reference implementation of the Vanadium APIs.

Unlike the APIs in https://github.com/vanadium/go.v23, which promises to provide backward compatibility this repository makes no such promises.