From 3b269d623b1e85ccace09e02684aeede928a23a8 Mon Sep 17 00:00:00 2001 From: Menno Finlay-Smits Date: Mon, 8 Jul 2019 13:01:20 +1200 Subject: [PATCH 1/3] Convert to use go modules instead of dep --- Gopkg.lock | 90 - Gopkg.toml | 7 - README.md | 3 +- go.mod | 10 + go.sum | 21 + vendor/github.com/alexflint/go-arg/.gitignore | 24 - .../github.com/alexflint/go-arg/.travis.yml | 13 - vendor/github.com/alexflint/go-arg/LICENSE | 24 - vendor/github.com/alexflint/go-arg/README.md | 361 --- vendor/github.com/alexflint/go-arg/doc.go | 39 - vendor/github.com/alexflint/go-arg/go.mod | 7 - vendor/github.com/alexflint/go-arg/go.sum | 14 - vendor/github.com/alexflint/go-arg/parse.go | 524 ---- vendor/github.com/alexflint/go-arg/usage.go | 157 - .../github.com/alexflint/go-scalar/.gitignore | 24 - .../alexflint/go-scalar/.travis.yml | 9 - vendor/github.com/alexflint/go-scalar/LICENSE | 24 - .../github.com/alexflint/go-scalar/README.md | 28 - vendor/github.com/alexflint/go-scalar/go.mod | 7 - vendor/github.com/alexflint/go-scalar/go.sum | 6 - .../github.com/alexflint/go-scalar/scalar.go | 153 - vendor/github.com/godbus/dbus/.travis.yml | 46 - vendor/github.com/godbus/dbus/CONTRIBUTING.md | 50 - vendor/github.com/godbus/dbus/LICENSE | 25 - vendor/github.com/godbus/dbus/MAINTAINERS | 3 - vendor/github.com/godbus/dbus/README.markdown | 44 - vendor/github.com/godbus/dbus/auth.go | 252 -- .../github.com/godbus/dbus/auth_anonymous.go | 16 - .../github.com/godbus/dbus/auth_external.go | 26 - vendor/github.com/godbus/dbus/auth_sha1.go | 102 - vendor/github.com/godbus/dbus/call.go | 60 - vendor/github.com/godbus/dbus/conn.go | 847 ------ vendor/github.com/godbus/dbus/conn_darwin.go | 37 - vendor/github.com/godbus/dbus/conn_other.go | 91 - vendor/github.com/godbus/dbus/conn_unix.go | 18 - vendor/github.com/godbus/dbus/conn_windows.go | 15 - vendor/github.com/godbus/dbus/dbus.go | 427 --- vendor/github.com/godbus/dbus/decoder.go | 235 -- .../github.com/godbus/dbus/default_handler.go | 321 -- vendor/github.com/godbus/dbus/doc.go | 69 - vendor/github.com/godbus/dbus/encoder.go | 210 -- vendor/github.com/godbus/dbus/export.go | 412 --- vendor/github.com/godbus/dbus/go.mod | 1 - vendor/github.com/godbus/dbus/homedir.go | 28 - .../github.com/godbus/dbus/homedir_dynamic.go | 15 - .../github.com/godbus/dbus/homedir_static.go | 45 - .../github.com/godbus/dbus/introspect/call.go | 27 - .../godbus/dbus/introspect/introspect.go | 86 - .../godbus/dbus/introspect/introspectable.go | 76 - vendor/github.com/godbus/dbus/message.go | 353 --- vendor/github.com/godbus/dbus/object.go | 219 -- .../godbus/dbus/server_interfaces.go | 99 - vendor/github.com/godbus/dbus/sig.go | 259 -- .../godbus/dbus/transport_darwin.go | 6 - .../godbus/dbus/transport_generic.go | 50 - .../godbus/dbus/transport_nonce_tcp.go | 39 - .../github.com/godbus/dbus/transport_tcp.go | 43 - .../github.com/godbus/dbus/transport_unix.go | 214 -- .../dbus/transport_unixcred_dragonfly.go | 95 - .../godbus/dbus/transport_unixcred_freebsd.go | 91 - .../godbus/dbus/transport_unixcred_linux.go | 25 - .../godbus/dbus/transport_unixcred_openbsd.go | 14 - vendor/github.com/godbus/dbus/variant.go | 144 - .../github.com/godbus/dbus/variant_lexer.go | 284 -- .../github.com/godbus/dbus/variant_parser.go | 817 ----- vendor/gopkg.in/yaml.v2/.travis.yml | 12 - vendor/gopkg.in/yaml.v2/LICENSE | 201 -- vendor/gopkg.in/yaml.v2/LICENSE.libyaml | 31 - vendor/gopkg.in/yaml.v2/NOTICE | 13 - vendor/gopkg.in/yaml.v2/README.md | 133 - vendor/gopkg.in/yaml.v2/apic.go | 739 ----- vendor/gopkg.in/yaml.v2/decode.go | 775 ----- vendor/gopkg.in/yaml.v2/emitterc.go | 1685 ----------- vendor/gopkg.in/yaml.v2/encode.go | 390 --- vendor/gopkg.in/yaml.v2/go.mod | 5 - vendor/gopkg.in/yaml.v2/parserc.go | 1095 ------- vendor/gopkg.in/yaml.v2/readerc.go | 412 --- vendor/gopkg.in/yaml.v2/resolve.go | 258 -- vendor/gopkg.in/yaml.v2/scannerc.go | 2696 ----------------- vendor/gopkg.in/yaml.v2/sorter.go | 113 - vendor/gopkg.in/yaml.v2/writerc.go | 26 - vendor/gopkg.in/yaml.v2/yaml.go | 466 --- vendor/gopkg.in/yaml.v2/yamlh.go | 738 ----- vendor/gopkg.in/yaml.v2/yamlprivateh.go | 173 -- vendor/periph.io/x/periph/.gitignore | 1 - vendor/periph.io/x/periph/.gohci.yml | 250 -- vendor/periph.io/x/periph/.travis.yml | 28 - vendor/periph.io/x/periph/AUTHORS | 15 - vendor/periph.io/x/periph/CONTRIBUTING.md | 4 - vendor/periph.io/x/periph/CONTRIBUTORS | 41 - vendor/periph.io/x/periph/LICENSE | 202 -- vendor/periph.io/x/periph/Makefile | 59 - vendor/periph.io/x/periph/README.md | 59 - vendor/periph.io/x/periph/conn/conn.go | 103 - vendor/periph.io/x/periph/conn/doc.go | 63 - .../periph.io/x/periph/conn/duplex_string.go | 3 - vendor/periph.io/x/periph/conn/gpio/func.go | 25 - vendor/periph.io/x/periph/conn/gpio/gpio.go | 329 -- .../x/periph/conn/gpio/gpioreg/gpioreg.go | 213 -- .../x/periph/conn/gpio/gpioreg/natsort.go | 76 - .../periph/conn/gpio/gpiostream/gpiostream.go | 220 -- vendor/periph.io/x/periph/conn/i2c/func.go | 12 - vendor/periph.io/x/periph/conn/i2c/i2c.go | 135 - .../x/periph/conn/i2c/i2creg/i2creg.go | 252 -- vendor/periph.io/x/periph/conn/physic/doc.go | 21 - .../periph.io/x/periph/conn/physic/physic.go | 42 - .../periph.io/x/periph/conn/physic/units.go | 2237 -------------- vendor/periph.io/x/periph/conn/pin/func.go | 58 - vendor/periph.io/x/periph/conn/pin/pin.go | 139 - .../periph.io/x/periph/conn/pin/pinreg/doc.go | 7 - .../x/periph/conn/pin/pinreg/pinreg.go | 148 - vendor/periph.io/x/periph/conn/spi/func.go | 14 - vendor/periph.io/x/periph/conn/spi/spi.go | 187 -- .../x/periph/conn/spi/spireg/spireg.go | 262 -- vendor/periph.io/x/periph/go.mod | 1 - .../periph.io/x/periph/host/allwinner/a20.go | 220 -- .../periph.io/x/periph/host/allwinner/a64.go | 174 -- .../x/periph/host/allwinner/allwinner_arm.go | 7 - .../periph/host/allwinner/allwinner_arm64.go | 9 - .../periph/host/allwinner/allwinner_other.go | 9 - .../x/periph/host/allwinner/clock.go | 281 -- .../x/periph/host/allwinner/detect.go | 98 - .../periph.io/x/periph/host/allwinner/dma.go | 474 --- .../periph.io/x/periph/host/allwinner/doc.go | 33 - .../periph.io/x/periph/host/allwinner/gpio.go | 1065 ------- .../x/periph/host/allwinner/gpio_pl.go | 563 ---- .../periph.io/x/periph/host/allwinner/pwm.go | 197 -- .../periph.io/x/periph/host/allwinner/r8.go | 149 - .../periph.io/x/periph/host/allwinner/spi.go | 207 -- .../x/periph/host/allwinner/timer.go | 128 - .../periph.io/x/periph/host/am335x/am335x.go | 52 - .../x/periph/host/am335x/am335x_arm.go | 7 - .../x/periph/host/am335x/am335x_other.go | 9 - vendor/periph.io/x/periph/host/am335x/doc.go | 28 - .../x/periph/host/bcm283x/bcm283x_arm.go | 7 - .../x/periph/host/bcm283x/bcm283x_arm64.go | 9 - .../x/periph/host/bcm283x/bcm283x_other.go | 9 - .../periph.io/x/periph/host/bcm283x/clock.go | 330 -- vendor/periph.io/x/periph/host/bcm283x/dma.go | 1224 -------- vendor/periph.io/x/periph/host/bcm283x/doc.go | 42 - .../periph.io/x/periph/host/bcm283x/gpio.go | 1361 --------- vendor/periph.io/x/periph/host/bcm283x/pcm.go | 234 -- vendor/periph.io/x/periph/host/bcm283x/pwm.go | 272 -- .../x/periph/host/bcm283x/streams.go | 134 - .../periph.io/x/periph/host/bcm283x/timer.go | 60 - .../x/periph/host/beagle/black/black.go | 34 - .../x/periph/host/beagle/black/black_arm.go | 7 - .../x/periph/host/beagle/black/black_other.go | 9 - .../x/periph/host/beagle/bone/bone.go | 318 -- .../x/periph/host/beagle/bone/bone_arm.go | 7 - .../x/periph/host/beagle/bone/bone_other.go | 9 - .../x/periph/host/beagle/green/green.go | 95 - .../x/periph/host/beagle/green/green_arm.go | 7 - .../x/periph/host/beagle/green/green_other.go | 9 - vendor/periph.io/x/periph/host/chip/chip.go | 358 --- .../periph.io/x/periph/host/chip/chip_arm.go | 7 - .../x/periph/host/chip/chip_other.go | 9 - vendor/periph.io/x/periph/host/chip/doc.go | 30 - vendor/periph.io/x/periph/host/cpu/cpu.go | 83 - .../periph.io/x/periph/host/cpu/cpu_linux.go | 22 - .../periph.io/x/periph/host/cpu/cpu_other.go | 14 - vendor/periph.io/x/periph/host/cpu/doc.go | 6 - .../periph.io/x/periph/host/distro/devtree.go | 61 - .../periph.io/x/periph/host/distro/distro.go | 189 -- .../x/periph/host/distro/distro_arm.go | 7 - .../x/periph/host/distro/distro_arm64.go | 9 - .../x/periph/host/distro/distro_linux.go | 7 - .../x/periph/host/distro/distro_nonarm.go | 9 - .../x/periph/host/distro/distro_nonlinux.go | 9 - vendor/periph.io/x/periph/host/doc.go | 10 - vendor/periph.io/x/periph/host/fs/fs.go | 100 - vendor/periph.io/x/periph/host/fs/fs_linux.go | 124 - vendor/periph.io/x/periph/host/fs/fs_other.go | 25 - vendor/periph.io/x/periph/host/fs/ioctl.go | 51 - .../x/periph/host/fs/ioctl_mips_like.go | 16 - .../periph.io/x/periph/host/fs/ioctl_other.go | 16 - vendor/periph.io/x/periph/host/host.go | 15 - vendor/periph.io/x/periph/host/host_arm.go | 20 - vendor/periph.io/x/periph/host/host_arm64.go | 13 - vendor/periph.io/x/periph/host/host_linux.go | 10 - .../periph.io/x/periph/host/odroidc1/doc.go | 26 - .../x/periph/host/odroidc1/odroidc1.go | 195 -- .../x/periph/host/odroidc1/odroidc1_arm.go | 7 - .../x/periph/host/odroidc1/odroidc1_other.go | 9 - vendor/periph.io/x/periph/host/pine64/doc.go | 15 - .../periph.io/x/periph/host/pine64/pine64.go | 272 -- .../x/periph/host/pine64/pine64_arm.go | 7 - .../x/periph/host/pine64/pine64_arm64.go | 9 - .../x/periph/host/pine64/pine64_other.go | 9 - vendor/periph.io/x/periph/host/pmem/alloc.go | 164 - vendor/periph.io/x/periph/host/pmem/doc.go | 69 - .../periph.io/x/periph/host/pmem/mem_linux.go | 56 - .../periph.io/x/periph/host/pmem/mem_other.go | 30 - .../periph.io/x/periph/host/pmem/pagemap.go | 64 - .../periph.io/x/periph/host/pmem/smoketest.go | 89 - vendor/periph.io/x/periph/host/pmem/view.go | 283 -- vendor/periph.io/x/periph/host/rpi/doc.go | 15 - vendor/periph.io/x/periph/host/rpi/rpi.go | 657 ---- vendor/periph.io/x/periph/host/rpi/rpi_arm.go | 7 - .../periph.io/x/periph/host/rpi/rpi_arm64.go | 9 - .../periph.io/x/periph/host/rpi/rpi_other.go | 9 - vendor/periph.io/x/periph/host/sysfs/doc.go | 13 - .../periph.io/x/periph/host/sysfs/fs_linux.go | 317 -- .../periph.io/x/periph/host/sysfs/fs_other.go | 15 - vendor/periph.io/x/periph/host/sysfs/gpio.go | 520 ---- vendor/periph.io/x/periph/host/sysfs/i2c.go | 388 --- vendor/periph.io/x/periph/host/sysfs/led.go | 267 -- vendor/periph.io/x/periph/host/sysfs/spi.go | 622 ---- vendor/periph.io/x/periph/host/sysfs/sysfs.go | 62 - .../x/periph/host/sysfs/sysfs_linux.go | 17 - .../x/periph/host/sysfs/sysfs_other.go | 14 - .../x/periph/host/sysfs/thermal_sensor.go | 261 -- .../x/periph/host/videocore/videocore.go | 229 -- vendor/periph.io/x/periph/periph.go | 298 -- vendor/periph.io/x/periph/periph_parallel.go | 101 - vendor/periph.io/x/periph/periph_serial.go | 55 - 216 files changed, 33 insertions(+), 37302 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml create mode 100644 go.mod create mode 100644 go.sum delete mode 100644 vendor/github.com/alexflint/go-arg/.gitignore delete mode 100644 vendor/github.com/alexflint/go-arg/.travis.yml delete mode 100644 vendor/github.com/alexflint/go-arg/LICENSE delete mode 100644 vendor/github.com/alexflint/go-arg/README.md delete mode 100644 vendor/github.com/alexflint/go-arg/doc.go delete mode 100644 vendor/github.com/alexflint/go-arg/go.mod delete mode 100644 vendor/github.com/alexflint/go-arg/go.sum delete mode 100644 vendor/github.com/alexflint/go-arg/parse.go delete mode 100644 vendor/github.com/alexflint/go-arg/usage.go delete mode 100644 vendor/github.com/alexflint/go-scalar/.gitignore delete mode 100644 vendor/github.com/alexflint/go-scalar/.travis.yml delete mode 100644 vendor/github.com/alexflint/go-scalar/LICENSE delete mode 100644 vendor/github.com/alexflint/go-scalar/README.md delete mode 100644 vendor/github.com/alexflint/go-scalar/go.mod delete mode 100644 vendor/github.com/alexflint/go-scalar/go.sum delete mode 100644 vendor/github.com/alexflint/go-scalar/scalar.go delete mode 100644 vendor/github.com/godbus/dbus/.travis.yml delete mode 100644 vendor/github.com/godbus/dbus/CONTRIBUTING.md delete mode 100644 vendor/github.com/godbus/dbus/LICENSE delete mode 100644 vendor/github.com/godbus/dbus/MAINTAINERS delete mode 100644 vendor/github.com/godbus/dbus/README.markdown delete mode 100644 vendor/github.com/godbus/dbus/auth.go delete mode 100644 vendor/github.com/godbus/dbus/auth_anonymous.go delete mode 100644 vendor/github.com/godbus/dbus/auth_external.go delete mode 100644 vendor/github.com/godbus/dbus/auth_sha1.go delete mode 100644 vendor/github.com/godbus/dbus/call.go delete mode 100644 vendor/github.com/godbus/dbus/conn.go delete mode 100644 vendor/github.com/godbus/dbus/conn_darwin.go delete mode 100644 vendor/github.com/godbus/dbus/conn_other.go delete mode 100644 vendor/github.com/godbus/dbus/conn_unix.go delete mode 100644 vendor/github.com/godbus/dbus/conn_windows.go delete mode 100644 vendor/github.com/godbus/dbus/dbus.go delete mode 100644 vendor/github.com/godbus/dbus/decoder.go delete mode 100644 vendor/github.com/godbus/dbus/default_handler.go delete mode 100644 vendor/github.com/godbus/dbus/doc.go delete mode 100644 vendor/github.com/godbus/dbus/encoder.go delete mode 100644 vendor/github.com/godbus/dbus/export.go delete mode 100644 vendor/github.com/godbus/dbus/go.mod delete mode 100644 vendor/github.com/godbus/dbus/homedir.go delete mode 100644 vendor/github.com/godbus/dbus/homedir_dynamic.go delete mode 100644 vendor/github.com/godbus/dbus/homedir_static.go delete mode 100644 vendor/github.com/godbus/dbus/introspect/call.go delete mode 100644 vendor/github.com/godbus/dbus/introspect/introspect.go delete mode 100644 vendor/github.com/godbus/dbus/introspect/introspectable.go delete mode 100644 vendor/github.com/godbus/dbus/message.go delete mode 100644 vendor/github.com/godbus/dbus/object.go delete mode 100644 vendor/github.com/godbus/dbus/server_interfaces.go delete mode 100644 vendor/github.com/godbus/dbus/sig.go delete mode 100644 vendor/github.com/godbus/dbus/transport_darwin.go delete mode 100644 vendor/github.com/godbus/dbus/transport_generic.go delete mode 100644 vendor/github.com/godbus/dbus/transport_nonce_tcp.go delete mode 100644 vendor/github.com/godbus/dbus/transport_tcp.go delete mode 100644 vendor/github.com/godbus/dbus/transport_unix.go delete mode 100644 vendor/github.com/godbus/dbus/transport_unixcred_dragonfly.go delete mode 100644 vendor/github.com/godbus/dbus/transport_unixcred_freebsd.go delete mode 100644 vendor/github.com/godbus/dbus/transport_unixcred_linux.go delete mode 100644 vendor/github.com/godbus/dbus/transport_unixcred_openbsd.go delete mode 100644 vendor/github.com/godbus/dbus/variant.go delete mode 100644 vendor/github.com/godbus/dbus/variant_lexer.go delete mode 100644 vendor/github.com/godbus/dbus/variant_parser.go delete mode 100644 vendor/gopkg.in/yaml.v2/.travis.yml delete mode 100644 vendor/gopkg.in/yaml.v2/LICENSE delete mode 100644 vendor/gopkg.in/yaml.v2/LICENSE.libyaml delete mode 100644 vendor/gopkg.in/yaml.v2/NOTICE delete mode 100644 vendor/gopkg.in/yaml.v2/README.md delete mode 100644 vendor/gopkg.in/yaml.v2/apic.go delete mode 100644 vendor/gopkg.in/yaml.v2/decode.go delete mode 100644 vendor/gopkg.in/yaml.v2/emitterc.go delete mode 100644 vendor/gopkg.in/yaml.v2/encode.go delete mode 100644 vendor/gopkg.in/yaml.v2/go.mod delete mode 100644 vendor/gopkg.in/yaml.v2/parserc.go delete mode 100644 vendor/gopkg.in/yaml.v2/readerc.go delete mode 100644 vendor/gopkg.in/yaml.v2/resolve.go delete mode 100644 vendor/gopkg.in/yaml.v2/scannerc.go delete mode 100644 vendor/gopkg.in/yaml.v2/sorter.go delete mode 100644 vendor/gopkg.in/yaml.v2/writerc.go delete mode 100644 vendor/gopkg.in/yaml.v2/yaml.go delete mode 100644 vendor/gopkg.in/yaml.v2/yamlh.go delete mode 100644 vendor/gopkg.in/yaml.v2/yamlprivateh.go delete mode 100644 vendor/periph.io/x/periph/.gitignore delete mode 100644 vendor/periph.io/x/periph/.gohci.yml delete mode 100644 vendor/periph.io/x/periph/.travis.yml delete mode 100644 vendor/periph.io/x/periph/AUTHORS delete mode 100644 vendor/periph.io/x/periph/CONTRIBUTING.md delete mode 100644 vendor/periph.io/x/periph/CONTRIBUTORS delete mode 100644 vendor/periph.io/x/periph/LICENSE delete mode 100644 vendor/periph.io/x/periph/Makefile delete mode 100644 vendor/periph.io/x/periph/README.md delete mode 100644 vendor/periph.io/x/periph/conn/conn.go delete mode 100644 vendor/periph.io/x/periph/conn/doc.go delete mode 100644 vendor/periph.io/x/periph/conn/duplex_string.go delete mode 100644 vendor/periph.io/x/periph/conn/gpio/func.go delete mode 100644 vendor/periph.io/x/periph/conn/gpio/gpio.go delete mode 100644 vendor/periph.io/x/periph/conn/gpio/gpioreg/gpioreg.go delete mode 100644 vendor/periph.io/x/periph/conn/gpio/gpioreg/natsort.go delete mode 100644 vendor/periph.io/x/periph/conn/gpio/gpiostream/gpiostream.go delete mode 100644 vendor/periph.io/x/periph/conn/i2c/func.go delete mode 100644 vendor/periph.io/x/periph/conn/i2c/i2c.go delete mode 100644 vendor/periph.io/x/periph/conn/i2c/i2creg/i2creg.go delete mode 100644 vendor/periph.io/x/periph/conn/physic/doc.go delete mode 100644 vendor/periph.io/x/periph/conn/physic/physic.go delete mode 100644 vendor/periph.io/x/periph/conn/physic/units.go delete mode 100644 vendor/periph.io/x/periph/conn/pin/func.go delete mode 100644 vendor/periph.io/x/periph/conn/pin/pin.go delete mode 100644 vendor/periph.io/x/periph/conn/pin/pinreg/doc.go delete mode 100644 vendor/periph.io/x/periph/conn/pin/pinreg/pinreg.go delete mode 100644 vendor/periph.io/x/periph/conn/spi/func.go delete mode 100644 vendor/periph.io/x/periph/conn/spi/spi.go delete mode 100644 vendor/periph.io/x/periph/conn/spi/spireg/spireg.go delete mode 100644 vendor/periph.io/x/periph/go.mod delete mode 100644 vendor/periph.io/x/periph/host/allwinner/a20.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/a64.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/allwinner_arm.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/allwinner_arm64.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/allwinner_other.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/clock.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/detect.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/dma.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/doc.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/gpio.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/gpio_pl.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/pwm.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/r8.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/spi.go delete mode 100644 vendor/periph.io/x/periph/host/allwinner/timer.go delete mode 100644 vendor/periph.io/x/periph/host/am335x/am335x.go delete mode 100644 vendor/periph.io/x/periph/host/am335x/am335x_arm.go delete mode 100644 vendor/periph.io/x/periph/host/am335x/am335x_other.go delete mode 100644 vendor/periph.io/x/periph/host/am335x/doc.go delete mode 100644 vendor/periph.io/x/periph/host/bcm283x/bcm283x_arm.go delete mode 100644 vendor/periph.io/x/periph/host/bcm283x/bcm283x_arm64.go delete mode 100644 vendor/periph.io/x/periph/host/bcm283x/bcm283x_other.go delete mode 100644 vendor/periph.io/x/periph/host/bcm283x/clock.go delete mode 100644 vendor/periph.io/x/periph/host/bcm283x/dma.go delete mode 100644 vendor/periph.io/x/periph/host/bcm283x/doc.go delete mode 100644 vendor/periph.io/x/periph/host/bcm283x/gpio.go delete mode 100644 vendor/periph.io/x/periph/host/bcm283x/pcm.go delete mode 100644 vendor/periph.io/x/periph/host/bcm283x/pwm.go delete mode 100644 vendor/periph.io/x/periph/host/bcm283x/streams.go delete mode 100644 vendor/periph.io/x/periph/host/bcm283x/timer.go delete mode 100644 vendor/periph.io/x/periph/host/beagle/black/black.go delete mode 100644 vendor/periph.io/x/periph/host/beagle/black/black_arm.go delete mode 100644 vendor/periph.io/x/periph/host/beagle/black/black_other.go delete mode 100644 vendor/periph.io/x/periph/host/beagle/bone/bone.go delete mode 100644 vendor/periph.io/x/periph/host/beagle/bone/bone_arm.go delete mode 100644 vendor/periph.io/x/periph/host/beagle/bone/bone_other.go delete mode 100644 vendor/periph.io/x/periph/host/beagle/green/green.go delete mode 100644 vendor/periph.io/x/periph/host/beagle/green/green_arm.go delete mode 100644 vendor/periph.io/x/periph/host/beagle/green/green_other.go delete mode 100644 vendor/periph.io/x/periph/host/chip/chip.go delete mode 100644 vendor/periph.io/x/periph/host/chip/chip_arm.go delete mode 100644 vendor/periph.io/x/periph/host/chip/chip_other.go delete mode 100644 vendor/periph.io/x/periph/host/chip/doc.go delete mode 100644 vendor/periph.io/x/periph/host/cpu/cpu.go delete mode 100644 vendor/periph.io/x/periph/host/cpu/cpu_linux.go delete mode 100644 vendor/periph.io/x/periph/host/cpu/cpu_other.go delete mode 100644 vendor/periph.io/x/periph/host/cpu/doc.go delete mode 100644 vendor/periph.io/x/periph/host/distro/devtree.go delete mode 100644 vendor/periph.io/x/periph/host/distro/distro.go delete mode 100644 vendor/periph.io/x/periph/host/distro/distro_arm.go delete mode 100644 vendor/periph.io/x/periph/host/distro/distro_arm64.go delete mode 100644 vendor/periph.io/x/periph/host/distro/distro_linux.go delete mode 100644 vendor/periph.io/x/periph/host/distro/distro_nonarm.go delete mode 100644 vendor/periph.io/x/periph/host/distro/distro_nonlinux.go delete mode 100644 vendor/periph.io/x/periph/host/doc.go delete mode 100644 vendor/periph.io/x/periph/host/fs/fs.go delete mode 100644 vendor/periph.io/x/periph/host/fs/fs_linux.go delete mode 100644 vendor/periph.io/x/periph/host/fs/fs_other.go delete mode 100644 vendor/periph.io/x/periph/host/fs/ioctl.go delete mode 100644 vendor/periph.io/x/periph/host/fs/ioctl_mips_like.go delete mode 100644 vendor/periph.io/x/periph/host/fs/ioctl_other.go delete mode 100644 vendor/periph.io/x/periph/host/host.go delete mode 100644 vendor/periph.io/x/periph/host/host_arm.go delete mode 100644 vendor/periph.io/x/periph/host/host_arm64.go delete mode 100644 vendor/periph.io/x/periph/host/host_linux.go delete mode 100644 vendor/periph.io/x/periph/host/odroidc1/doc.go delete mode 100644 vendor/periph.io/x/periph/host/odroidc1/odroidc1.go delete mode 100644 vendor/periph.io/x/periph/host/odroidc1/odroidc1_arm.go delete mode 100644 vendor/periph.io/x/periph/host/odroidc1/odroidc1_other.go delete mode 100644 vendor/periph.io/x/periph/host/pine64/doc.go delete mode 100644 vendor/periph.io/x/periph/host/pine64/pine64.go delete mode 100644 vendor/periph.io/x/periph/host/pine64/pine64_arm.go delete mode 100644 vendor/periph.io/x/periph/host/pine64/pine64_arm64.go delete mode 100644 vendor/periph.io/x/periph/host/pine64/pine64_other.go delete mode 100644 vendor/periph.io/x/periph/host/pmem/alloc.go delete mode 100644 vendor/periph.io/x/periph/host/pmem/doc.go delete mode 100644 vendor/periph.io/x/periph/host/pmem/mem_linux.go delete mode 100644 vendor/periph.io/x/periph/host/pmem/mem_other.go delete mode 100644 vendor/periph.io/x/periph/host/pmem/pagemap.go delete mode 100644 vendor/periph.io/x/periph/host/pmem/smoketest.go delete mode 100644 vendor/periph.io/x/periph/host/pmem/view.go delete mode 100644 vendor/periph.io/x/periph/host/rpi/doc.go delete mode 100644 vendor/periph.io/x/periph/host/rpi/rpi.go delete mode 100644 vendor/periph.io/x/periph/host/rpi/rpi_arm.go delete mode 100644 vendor/periph.io/x/periph/host/rpi/rpi_arm64.go delete mode 100644 vendor/periph.io/x/periph/host/rpi/rpi_other.go delete mode 100644 vendor/periph.io/x/periph/host/sysfs/doc.go delete mode 100644 vendor/periph.io/x/periph/host/sysfs/fs_linux.go delete mode 100644 vendor/periph.io/x/periph/host/sysfs/fs_other.go delete mode 100644 vendor/periph.io/x/periph/host/sysfs/gpio.go delete mode 100644 vendor/periph.io/x/periph/host/sysfs/i2c.go delete mode 100644 vendor/periph.io/x/periph/host/sysfs/led.go delete mode 100644 vendor/periph.io/x/periph/host/sysfs/spi.go delete mode 100644 vendor/periph.io/x/periph/host/sysfs/sysfs.go delete mode 100644 vendor/periph.io/x/periph/host/sysfs/sysfs_linux.go delete mode 100644 vendor/periph.io/x/periph/host/sysfs/sysfs_other.go delete mode 100644 vendor/periph.io/x/periph/host/sysfs/thermal_sensor.go delete mode 100644 vendor/periph.io/x/periph/host/videocore/videocore.go delete mode 100644 vendor/periph.io/x/periph/periph.go delete mode 100644 vendor/periph.io/x/periph/periph_parallel.go delete mode 100644 vendor/periph.io/x/periph/periph_serial.go diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 53114da..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,90 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:211fb215a5ea359a0661808c1b42687138c430a156e31081b09433640a4be0b9" - name = "github.com/alexflint/go-arg" - packages = ["."] - pruneopts = "UT" - revision = "f40417ef119019b1c94b79f3f18b7f66b9fb6bce" - version = "v1.0.0" - -[[projects]] - digest = "1:38d698f47024bd1358f279ae302feb5e1b7de647635b578ed1e681b259767118" - name = "github.com/alexflint/go-scalar" - packages = ["."] - pruneopts = "UT" - revision = "6638fbbc28f9ad0136ef5fd84a15c995e08e161f" - version = "v1.0.0" - -[[projects]] - digest = "1:845b7e5613e043a3c519bc380295688b7e69ec2e3f211606fa2d028b5adf2e53" - name = "github.com/godbus/dbus" - packages = [ - ".", - "introspect", - ] - pruneopts = "UT" - revision = "2ff6f7ffd60f0f2410b3105864bdd12c7894f844" - version = "v5.0.1" - -[[projects]] - digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96" - name = "gopkg.in/yaml.v2" - packages = ["."] - pruneopts = "UT" - revision = "51d6538a90f86fe93ac480b35f37b2be17fef232" - version = "v2.2.2" - -[[projects]] - digest = "1:3c601acbceaab728eabb766984ac955c26c5d8232b262571971b12dbbbd66e65" - name = "periph.io/x/periph" - packages = [ - ".", - "conn", - "conn/gpio", - "conn/gpio/gpioreg", - "conn/gpio/gpiostream", - "conn/i2c", - "conn/i2c/i2creg", - "conn/physic", - "conn/pin", - "conn/pin/pinreg", - "conn/spi", - "conn/spi/spireg", - "host", - "host/allwinner", - "host/am335x", - "host/bcm283x", - "host/beagle/black", - "host/beagle/bone", - "host/beagle/green", - "host/chip", - "host/cpu", - "host/distro", - "host/fs", - "host/odroidc1", - "host/pine64", - "host/pmem", - "host/rpi", - "host/sysfs", - "host/videocore", - ] - pruneopts = "UT" - revision = "df7c7a4f8f86972b1474695daf94a84c9165faed" - version = "v3.5.0" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/alexflint/go-arg", - "github.com/godbus/dbus", - "github.com/godbus/dbus/introspect", - "gopkg.in/yaml.v2", - "periph.io/x/periph/conn/gpio", - "periph.io/x/periph/conn/gpio/gpioreg", - "periph.io/x/periph/host", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index e6330ac..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,7 +0,0 @@ -[[constraint]] - name = "github.com/alexflint/go-arg" - version = "^1.0.0" - -[prune] - go-tests = true - unused-packages = true diff --git a/README.md b/README.md index c32357a..b671603 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # modemd -App for controlling the USB modems plugged into the Raspberry Pi + +App for controlling the USB modems plugged into the Raspberry Pi. diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..b737509 --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/TheCacophonyProject/modemd + +go 1.12 + +require ( + github.com/alexflint/go-arg v1.0.0 + github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f + gopkg.in/yaml.v2 v2.2.2 + periph.io/x/periph v0.0.0-20190218125427-df7c7a4f8f86 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..28f67a4 --- /dev/null +++ b/go.sum @@ -0,0 +1,21 @@ +github.com/alexflint/go-arg v1.0.0 h1:VWNnY3DyBHiq5lcwY2FlCE5t5qyHNV0o5i1bkCIHprU= +github.com/alexflint/go-arg v1.0.0/go.mod h1:Cto8k5VtkP4pp0EXiWD4ZJMFOOinZ38ggVcQ/6CGuRI= +github.com/alexflint/go-scalar v1.0.0 h1:NGupf1XV/Xb04wXskDFzS0KWOLH632W/EO4fAFi+A70= +github.com/alexflint/go-scalar v1.0.0/go.mod h1:GpHzbCOZXEKMEcygYQ5n/aa4Aq84zbxjy3MxYW0gjYw= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f h1:zlOR3rOlPAVvtfuxGKoghCmop5B0TRyu/ZieziZuGiM= +github.com/godbus/dbus v0.0.0-20181101234600-2ff6f7ffd60f/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +periph.io/x/periph v0.0.0-20190218125427-df7c7a4f8f86 h1:qyalv/ClPLE2zvu48IhBmqcZZp3+XngDNCIwruFRW78= +periph.io/x/periph v0.0.0-20190218125427-df7c7a4f8f86/go.mod h1:EWr+FCIU2dBWz5/wSWeiIUJTriYv9v2j2ENBmgYyy7Y= diff --git a/vendor/github.com/alexflint/go-arg/.gitignore b/vendor/github.com/alexflint/go-arg/.gitignore deleted file mode 100644 index daf913b..0000000 --- a/vendor/github.com/alexflint/go-arg/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/vendor/github.com/alexflint/go-arg/.travis.yml b/vendor/github.com/alexflint/go-arg/.travis.yml deleted file mode 100644 index 465683c..0000000 --- a/vendor/github.com/alexflint/go-arg/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go -go: - - "1.10" - - "1.11" - - tip -env: - - GO111MODULE=on # will only be used in go 1.11 -before_install: - - go get github.com/axw/gocov/gocov - - go get github.com/mattn/goveralls - - if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi -script: - - $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/vendor/github.com/alexflint/go-arg/LICENSE b/vendor/github.com/alexflint/go-arg/LICENSE deleted file mode 100644 index a50c494..0000000 --- a/vendor/github.com/alexflint/go-arg/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2015, Alex Flint -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/alexflint/go-arg/README.md b/vendor/github.com/alexflint/go-arg/README.md deleted file mode 100644 index 8e68ca7..0000000 --- a/vendor/github.com/alexflint/go-arg/README.md +++ /dev/null @@ -1,361 +0,0 @@ -[![GoDoc](https://godoc.org/github.com/alexflint/go-arg?status.svg)](https://godoc.org/github.com/alexflint/go-arg) -[![Build Status](https://travis-ci.org/alexflint/go-arg.svg?branch=master)](https://travis-ci.org/alexflint/go-arg) -[![Coverage Status](https://coveralls.io/repos/alexflint/go-arg/badge.svg?branch=master&service=github)](https://coveralls.io/github/alexflint/go-arg?branch=master) -[![Report Card](https://goreportcard.com/badge/github.com/alexflint/go-arg)](https://goreportcard.com/badge/github.com/alexflint/go-arg) - -## Structured argument parsing for Go - -```shell -go get github.com/alexflint/go-arg -``` - -Declare the command line arguments your program accepts by defining a struct. - -```go -var args struct { - Foo string - Bar bool -} -arg.MustParse(&args) -fmt.Println(args.Foo, args.Bar) -``` - -```shell -$ ./example --foo=hello --bar -hello true -``` - -### Required arguments - -```go -var args struct { - ID int `arg:"required"` - Timeout time.Duration -} -arg.MustParse(&args) -``` - -```shell -$ ./example -Usage: example --id ID [--timeout TIMEOUT] -error: --id is required -``` - -### Positional arguments - -```go -var args struct { - Input string `arg:"positional"` - Output []string `arg:"positional"` -} -arg.MustParse(&args) -fmt.Println("Input:", args.Input) -fmt.Println("Output:", args.Output) -``` - -``` -$ ./example src.txt x.out y.out z.out -Input: src.txt -Output: [x.out y.out z.out] -``` - -### Environment variables - -```go -var args struct { - Workers int `arg:"env"` -} -arg.MustParse(&args) -fmt.Println("Workers:", args.Workers) -``` - -``` -$ WORKERS=4 ./example -Workers: 4 -``` - -``` -$ WORKERS=4 ./example --workers=6 -Workers: 6 -``` - -You can also override the name of the environment variable: - -```go -var args struct { - Workers int `arg:"env:NUM_WORKERS"` -} -arg.MustParse(&args) -fmt.Println("Workers:", args.Workers) -``` - -``` -$ NUM_WORKERS=4 ./example -Workers: 4 -``` - -You can provide multiple values using the CSV (RFC 4180) format: - -```go -var args struct { - Workers []int `arg:"env"` -} -arg.MustParse(&args) -fmt.Println("Workers:", args.Workers) -``` - -``` -$ WORKERS='1,99' ./example -Workers: [1 99] -``` - -### Usage strings -```go -var args struct { - Input string `arg:"positional"` - Output []string `arg:"positional"` - Verbose bool `arg:"-v" help:"verbosity level"` - Dataset string `help:"dataset to use"` - Optimize int `arg:"-O" help:"optimization level"` -} -arg.MustParse(&args) -``` - -```shell -$ ./example -h -Usage: [--verbose] [--dataset DATASET] [--optimize OPTIMIZE] [--help] INPUT [OUTPUT [OUTPUT ...]] - -Positional arguments: - INPUT - OUTPUT - -Options: - --verbose, -v verbosity level - --dataset DATASET dataset to use - --optimize OPTIMIZE, -O OPTIMIZE - optimization level - --help, -h print this help message -``` - -As the example above shows, the `help` tag can be used in conjunction with `arg`, or instead. When used -together, they can appear in either order. - -### Default values - -```go -var args struct { - Foo string - Bar bool -} -args.Foo = "default value" -arg.MustParse(&args) -``` - -### Arguments with multiple values -```go -var args struct { - Database string - IDs []int64 -} -arg.MustParse(&args) -fmt.Printf("Fetching the following IDs from %s: %q", args.Database, args.IDs) -``` - -```shell -./example -database foo -ids 1 2 3 -Fetching the following IDs from foo: [1 2 3] -``` - -### Arguments that can be specified multiple times, mixed with positionals -```go -var args struct { - Commands []string `arg:"-c,separate"` - Files []string `arg:"-f,separate"` - Databases []string `arg:"positional"` -} -``` - -```shell -./example -c cmd1 db1 -f file1 db2 -c cmd2 -f file2 -f file3 db3 -c cmd3 -Commands: [cmd1 cmd2 cmd3] -Files [file1 file2 file3] -Databases [db1 db2 db3] -``` - -### Custom validation -```go -var args struct { - Foo string - Bar string -} -p := arg.MustParse(&args) -if args.Foo == "" && args.Bar == "" { - p.Fail("you must provide one of --foo and --bar") -} -``` - -```shell -./example -Usage: samples [--foo FOO] [--bar BAR] -error: you must provide one of --foo and --bar -``` - -### Version strings - -```go -type args struct { - ... -} - -func (args) Version() string { - return "someprogram 4.3.0" -} - -func main() { - var args args - arg.MustParse(&args) -} -``` - -```shell -$ ./example --version -someprogram 4.3.0 -``` - -### Embedded structs - -The fields of embedded structs are treated just like regular fields: - -```go - -type DatabaseOptions struct { - Host string - Username string - Password string -} - -type LogOptions struct { - LogFile string - Verbose bool -} - -func main() { - var args struct { - DatabaseOptions - LogOptions - } - arg.MustParse(&args) -} -``` - -As usual, any field tagged with `arg:"-"` is ignored. - -### Custom parsing - -You can implement your own argument parser by implementing `encoding.TextUnmarshaler`: - -```go -package main - -import ( - "fmt" - "strings" - - "github.com/alexflint/go-arg" -) - -// Accepts command line arguments of the form "head.tail" -type NameDotName struct { - Head, Tail string -} - -func (n *NameDotName) UnmarshalText(b []byte) error { - s := string(b) - pos := strings.Index(s, ".") - if pos == -1 { - return fmt.Errorf("missing period in %s", s) - } - n.Head = s[:pos] - n.Tail = s[pos+1:] - return nil -} - -// optional: implement in case you want to display a default value in the usage string -func (n *NameDotName) MarshalText() (text []byte, err error) { - text = []byte(fmt.Sprintf("%s.%s", n.Head, n.Tail)) - return -} - -func main() { - var args struct { - Name NameDotName - } - // set default - args.Name = NameDotName{"file", "txt"} - arg.MustParse(&args) - fmt.Printf("%#v\n", args.Name) -} -``` -```shell -$ ./example --help -Usage: test [--name NAME] - -Options: - --name NAME [default: file.txt] - --help, -h display this help and exit - -$ ./example -main.NameDotName{Head:"file", Tail:"txt"} - -$ ./example --name=foo.bar -main.NameDotName{Head:"foo", Tail:"bar"} - -$ ./example --name=oops -Usage: example [--name NAME] -error: error processing --name: missing period in "oops" -``` - -### Description strings - -```go -type args struct { - Foo string -} - -func (args) Description() string { - return "this program does this and that" -} - -func main() { - var args args - arg.MustParse(&args) -} -``` - -```shell -$ ./example -h -this program does this and that -Usage: example [--foo FOO] - -Options: - --foo FOO - --help, -h display this help and exit -``` - -### API Documentation - -https://godoc.org/github.com/alexflint/go-arg - -### Rationale - -There are many command line argument parsing libraries for Go, including one in the standard library, so why build another? - -The shortcomings of the `flag` library that ships in the standard library are well known. Positional arguments must preceed options, so `./prog x --foo=1` does what you expect but `./prog --foo=1 x` does not. Arguments cannot have both long (`--foo`) and short (`-f`) forms. - -Many third-party argument parsing libraries are geared for writing sophisticated command line interfaces. The excellent `codegangsta/cli` is perfect for working with multiple sub-commands and nested flags, but is probably overkill for a simple script with a handful of flags. - -The main idea behind `go-arg` is that Go already has an excellent way to describe data structures using Go structs, so there is no need to develop more levels of abstraction on top of this. Instead of one API to specify which arguments your program accepts, and then another API to get the values of those arguments, why not replace both with a single struct? - -### Backward Compatibility Notes - -The tags have changed recently. Earlier versions required the help text to be part of the `arg` tag. This is still supported but is now deprecated. Instead, you should use a separate `help` tag, described above, which removes most of the limits on the text you can write. In particular, you will need to use the new `help` tag if your help text includes any commas. diff --git a/vendor/github.com/alexflint/go-arg/doc.go b/vendor/github.com/alexflint/go-arg/doc.go deleted file mode 100644 index 3b0bafd..0000000 --- a/vendor/github.com/alexflint/go-arg/doc.go +++ /dev/null @@ -1,39 +0,0 @@ -// Package arg parses command line arguments using the fields from a struct. -// -// For example, -// -// var args struct { -// Iter int -// Debug bool -// } -// arg.MustParse(&args) -// -// defines two command line arguments, which can be set using any of -// -// ./example --iter=1 --debug // debug is a boolean flag so its value is set to true -// ./example -iter 1 // debug defaults to its zero value (false) -// ./example --debug=true // iter defaults to its zero value (zero) -// -// The fastest way to see how to use go-arg is to read the examples below. -// -// Fields can be bool, string, any float type, or any signed or unsigned integer type. -// They can also be slices of any of the above, or slices of pointers to any of the above. -// -// Tags can be specified using the `arg` and `help` tag names: -// -// var args struct { -// Input string `arg:"positional"` -// Log string `arg:"positional,required"` -// Debug bool `arg:"-d" help:"turn on debug mode"` -// RealMode bool `arg:"--real" -// Wr io.Writer `arg:"-"` -// } -// -// Any tag string that starts with a single hyphen is the short form for an argument -// (e.g. `./example -d`), and any tag string that starts with two hyphens is the long -// form for the argument (instead of the field name). -// -// Other valid tag strings are `positional` and `required`. -// -// Fields can be excluded from processing with `arg:"-"`. -package arg diff --git a/vendor/github.com/alexflint/go-arg/go.mod b/vendor/github.com/alexflint/go-arg/go.mod deleted file mode 100644 index f71a904..0000000 --- a/vendor/github.com/alexflint/go-arg/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/alexflint/go-arg - -require ( - github.com/alexflint/go-scalar v1.0.0 - github.com/kr/pretty v0.1.0 - github.com/stretchr/testify v1.2.2 -) diff --git a/vendor/github.com/alexflint/go-arg/go.sum b/vendor/github.com/alexflint/go-arg/go.sum deleted file mode 100644 index 9e10a3f..0000000 --- a/vendor/github.com/alexflint/go-arg/go.sum +++ /dev/null @@ -1,14 +0,0 @@ -github.com/alexflint/go-scalar v1.0.0 h1:NGupf1XV/Xb04wXskDFzS0KWOLH632W/EO4fAFi+A70= -github.com/alexflint/go-scalar v1.0.0/go.mod h1:GpHzbCOZXEKMEcygYQ5n/aa4Aq84zbxjy3MxYW0gjYw= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.1.3/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= diff --git a/vendor/github.com/alexflint/go-arg/parse.go b/vendor/github.com/alexflint/go-arg/parse.go deleted file mode 100644 index 3c682f5..0000000 --- a/vendor/github.com/alexflint/go-arg/parse.go +++ /dev/null @@ -1,524 +0,0 @@ -package arg - -import ( - "encoding" - "encoding/csv" - "errors" - "fmt" - "os" - "path/filepath" - "reflect" - "strings" - - scalar "github.com/alexflint/go-scalar" -) - -// spec represents a command line option -type spec struct { - dest reflect.Value - long string - short string - multiple bool - required bool - positional bool - separate bool - help string - env string - wasPresent bool - boolean bool -} - -// ErrHelp indicates that -h or --help were provided -var ErrHelp = errors.New("help requested by user") - -// ErrVersion indicates that --version was provided -var ErrVersion = errors.New("version requested by user") - -// MustParse processes command line arguments and exits upon failure -func MustParse(dest ...interface{}) *Parser { - p, err := NewParser(Config{}, dest...) - if err != nil { - fmt.Println(err) - os.Exit(-1) - } - err = p.Parse(flags()) - if err == ErrHelp { - p.WriteHelp(os.Stdout) - os.Exit(0) - } - if err == ErrVersion { - fmt.Println(p.version) - os.Exit(0) - } - if err != nil { - p.Fail(err.Error()) - } - return p -} - -// Parse processes command line arguments and stores them in dest -func Parse(dest ...interface{}) error { - p, err := NewParser(Config{}, dest...) - if err != nil { - return err - } - return p.Parse(flags()) -} - -// flags gets all command line arguments other than the first (program name) -func flags() []string { - if len(os.Args) == 0 { // os.Args could be empty - return nil - } - return os.Args[1:] -} - -// Config represents configuration options for an argument parser -type Config struct { - Program string // Program is the name of the program used in the help text -} - -// Parser represents a set of command line options with destination values -type Parser struct { - spec []*spec - config Config - version string - description string -} - -// Versioned is the interface that the destination struct should implement to -// make a version string appear at the top of the help message. -type Versioned interface { - // Version returns the version string that will be printed on a line by itself - // at the top of the help message. - Version() string -} - -// Described is the interface that the destination struct should implement to -// make a description string appear at the top of the help message. -type Described interface { - // Description returns the string that will be printed on a line by itself - // at the top of the help message. - Description() string -} - -// walkFields calls a function for each field of a struct, recursively expanding struct fields. -func walkFields(v reflect.Value, visit func(field reflect.StructField, val reflect.Value, owner reflect.Type) bool) { - t := v.Type() - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - val := v.Field(i) - expand := visit(field, val, t) - if expand && field.Type.Kind() == reflect.Struct { - walkFields(val, visit) - } - } -} - -// NewParser constructs a parser from a list of destination structs -func NewParser(config Config, dests ...interface{}) (*Parser, error) { - p := Parser{ - config: config, - } - for _, dest := range dests { - if dest, ok := dest.(Versioned); ok { - p.version = dest.Version() - } - if dest, ok := dest.(Described); ok { - p.description = dest.Description() - } - v := reflect.ValueOf(dest) - if v.Kind() != reflect.Ptr { - panic(fmt.Sprintf("%s is not a pointer (did you forget an ampersand?)", v.Type())) - } - v = v.Elem() - if v.Kind() != reflect.Struct { - panic(fmt.Sprintf("%T is not a struct pointer", dest)) - } - - var errs []string - walkFields(v, func(field reflect.StructField, val reflect.Value, t reflect.Type) bool { - // Check for the ignore switch in the tag - tag := field.Tag.Get("arg") - if tag == "-" { - return false - } - - // If this is an embedded struct then recurse into its fields - if field.Anonymous && field.Type.Kind() == reflect.Struct { - return true - } - - spec := spec{ - long: strings.ToLower(field.Name), - dest: val, - } - - help, exists := field.Tag.Lookup("help") - if exists { - spec.help = help - } - - // Check whether this field is supported. It's good to do this here rather than - // wait until ParseValue because it means that a program with invalid argument - // fields will always fail regardless of whether the arguments it received - // exercised those fields. - var parseable bool - parseable, spec.boolean, spec.multiple = canParse(field.Type) - if !parseable { - errs = append(errs, fmt.Sprintf("%s.%s: %s fields are not supported", - t.Name(), field.Name, field.Type.String())) - return false - } - - // Look at the tag - if tag != "" { - for _, key := range strings.Split(tag, ",") { - key = strings.TrimLeft(key, " ") - var value string - if pos := strings.Index(key, ":"); pos != -1 { - value = key[pos+1:] - key = key[:pos] - } - - switch { - case strings.HasPrefix(key, "---"): - errs = append(errs, fmt.Sprintf("%s.%s: too many hyphens", t.Name(), field.Name)) - case strings.HasPrefix(key, "--"): - spec.long = key[2:] - case strings.HasPrefix(key, "-"): - if len(key) != 2 { - errs = append(errs, fmt.Sprintf("%s.%s: short arguments must be one character only", - t.Name(), field.Name)) - return false - } - spec.short = key[1:] - case key == "required": - spec.required = true - case key == "positional": - spec.positional = true - case key == "separate": - spec.separate = true - case key == "help": // deprecated - spec.help = value - case key == "env": - // Use override name if provided - if value != "" { - spec.env = value - } else { - spec.env = strings.ToUpper(field.Name) - } - default: - errs = append(errs, fmt.Sprintf("unrecognized tag '%s' on field %s", key, tag)) - return false - } - } - } - p.spec = append(p.spec, &spec) - - // if this was an embedded field then we already returned true up above - return false - }) - - if len(errs) > 0 { - return nil, errors.New(strings.Join(errs, "\n")) - } - } - if p.config.Program == "" { - p.config.Program = "program" - if len(os.Args) > 0 { - p.config.Program = filepath.Base(os.Args[0]) - } - } - return &p, nil -} - -// Parse processes the given command line option, storing the results in the field -// of the structs from which NewParser was constructed -func (p *Parser) Parse(args []string) error { - // If -h or --help were specified then print usage - for _, arg := range args { - if arg == "-h" || arg == "--help" { - return ErrHelp - } - if arg == "--version" { - return ErrVersion - } - if arg == "--" { - break - } - } - - // Process all command line arguments - err := process(p.spec, args) - if err != nil { - return err - } - - // Validate - return validate(p.spec) -} - -// process goes through arguments one-by-one, parses them, and assigns the result to -// the underlying struct field -func process(specs []*spec, args []string) error { - // construct a map from --option to spec - optionMap := make(map[string]*spec) - for _, spec := range specs { - if spec.positional { - continue - } - if spec.long != "" { - optionMap[spec.long] = spec - } - if spec.short != "" { - optionMap[spec.short] = spec - } - if spec.env != "" { - if value, found := os.LookupEnv(spec.env); found { - if spec.multiple { - // expect a CSV string in an environment - // variable in the case of multiple values - values, err := csv.NewReader(strings.NewReader(value)).Read() - if err != nil { - return fmt.Errorf( - "error reading a CSV string from environment variable %s with multiple values: %v", - spec.env, - err, - ) - } - if err = setSlice(spec.dest, values, !spec.separate); err != nil { - return fmt.Errorf( - "error processing environment variable %s with multiple values: %v", - spec.env, - err, - ) - } - } else { - if err := scalar.ParseValue(spec.dest, value); err != nil { - return fmt.Errorf("error processing environment variable %s: %v", spec.env, err) - } - } - spec.wasPresent = true - } - } - } - - // process each string from the command line - var allpositional bool - var positionals []string - - // must use explicit for loop, not range, because we manipulate i inside the loop - for i := 0; i < len(args); i++ { - arg := args[i] - if arg == "--" { - allpositional = true - continue - } - - if !isFlag(arg) || allpositional { - positionals = append(positionals, arg) - continue - } - - // check for an equals sign, as in "--foo=bar" - var value string - opt := strings.TrimLeft(arg, "-") - if pos := strings.Index(opt, "="); pos != -1 { - value = opt[pos+1:] - opt = opt[:pos] - } - - // lookup the spec for this option - spec, ok := optionMap[opt] - if !ok { - return fmt.Errorf("unknown argument %s", arg) - } - spec.wasPresent = true - - // deal with the case of multiple values - if spec.multiple { - var values []string - if value == "" { - for i+1 < len(args) && !isFlag(args[i+1]) { - values = append(values, args[i+1]) - i++ - if spec.separate { - break - } - } - } else { - values = append(values, value) - } - err := setSlice(spec.dest, values, !spec.separate) - if err != nil { - return fmt.Errorf("error processing %s: %v", arg, err) - } - continue - } - - // if it's a flag and it has no value then set the value to true - // use boolean because this takes account of TextUnmarshaler - if spec.boolean && value == "" { - value = "true" - } - - // if we have something like "--foo" then the value is the next argument - if value == "" { - if i+1 == len(args) { - return fmt.Errorf("missing value for %s", arg) - } - if !nextIsNumeric(spec.dest.Type(), args[i+1]) && isFlag(args[i+1]) { - return fmt.Errorf("missing value for %s", arg) - } - value = args[i+1] - i++ - } - - err := scalar.ParseValue(spec.dest, value) - if err != nil { - return fmt.Errorf("error processing %s: %v", arg, err) - } - } - - // process positionals - for _, spec := range specs { - if spec.positional { - if spec.multiple { - if spec.required && len(positionals) == 0 { - return fmt.Errorf("%s is required", spec.long) - } - err := setSlice(spec.dest, positionals, true) - if err != nil { - return fmt.Errorf("error processing %s: %v", spec.long, err) - } - positionals = nil - } else if len(positionals) > 0 { - err := scalar.ParseValue(spec.dest, positionals[0]) - if err != nil { - return fmt.Errorf("error processing %s: %v", spec.long, err) - } - positionals = positionals[1:] - } else if spec.required { - return fmt.Errorf("%s is required", spec.long) - } - } - } - if len(positionals) > 0 { - return fmt.Errorf("too many positional arguments at '%s'", positionals[0]) - } - return nil -} - -func nextIsNumeric(t reflect.Type, s string) bool { - switch t.Kind() { - case reflect.Ptr: - return nextIsNumeric(t.Elem(), s) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Float32, reflect.Float64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - v := reflect.New(t) - err := scalar.ParseValue(v, s) - return err == nil - default: - return false - } -} - -// isFlag returns true if a token is a flag such as "-v" or "--user" but not "-" or "--" -func isFlag(s string) bool { - return strings.HasPrefix(s, "-") && strings.TrimLeft(s, "-") != "" -} - -// validate an argument spec after arguments have been parse -func validate(spec []*spec) error { - for _, arg := range spec { - if !arg.positional && arg.required && !arg.wasPresent { - return fmt.Errorf("--%s is required", arg.long) - } - } - return nil -} - -// parse a value as the appropriate type and store it in the struct -func setSlice(dest reflect.Value, values []string, trunc bool) error { - if !dest.CanSet() { - return fmt.Errorf("field is not writable") - } - - var ptr bool - elem := dest.Type().Elem() - if elem.Kind() == reflect.Ptr && !elem.Implements(textUnmarshalerType) { - ptr = true - elem = elem.Elem() - } - - // Truncate the dest slice in case default values exist - if trunc && !dest.IsNil() { - dest.SetLen(0) - } - - for _, s := range values { - v := reflect.New(elem) - if err := scalar.ParseValue(v.Elem(), s); err != nil { - return err - } - if !ptr { - v = v.Elem() - } - dest.Set(reflect.Append(dest, v)) - } - return nil -} - -// canParse returns true if the type can be parsed from a string -func canParse(t reflect.Type) (parseable, boolean, multiple bool) { - parseable = scalar.CanParse(t) - boolean = isBoolean(t) - if parseable { - return - } - - // Look inside pointer types - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - // Look inside slice types - if t.Kind() == reflect.Slice { - multiple = true - t = t.Elem() - } - - parseable = scalar.CanParse(t) - boolean = isBoolean(t) - if parseable { - return - } - - // Look inside pointer types (again, in case of []*Type) - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - - parseable = scalar.CanParse(t) - boolean = isBoolean(t) - if parseable { - return - } - - return false, false, false -} - -var textUnmarshalerType = reflect.TypeOf([]encoding.TextUnmarshaler{}).Elem() - -// isBoolean returns true if the type can be parsed from a single string -func isBoolean(t reflect.Type) bool { - switch { - case t.Implements(textUnmarshalerType): - return false - case t.Kind() == reflect.Bool: - return true - case t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Bool: - return true - default: - return false - } -} diff --git a/vendor/github.com/alexflint/go-arg/usage.go b/vendor/github.com/alexflint/go-arg/usage.go deleted file mode 100644 index 656ee9a..0000000 --- a/vendor/github.com/alexflint/go-arg/usage.go +++ /dev/null @@ -1,157 +0,0 @@ -package arg - -import ( - "fmt" - "io" - "os" - "reflect" - "strings" - "encoding" -) - -// the width of the left column -const colWidth = 25 - -// Fail prints usage information to stderr and exits with non-zero status -func (p *Parser) Fail(msg string) { - p.WriteUsage(os.Stderr) - fmt.Fprintln(os.Stderr, "error:", msg) - os.Exit(-1) -} - -// WriteUsage writes usage information to the given writer -func (p *Parser) WriteUsage(w io.Writer) { - var positionals, options []*spec - for _, spec := range p.spec { - if spec.positional { - positionals = append(positionals, spec) - } else { - options = append(options, spec) - } - } - - if p.version != "" { - fmt.Fprintln(w, p.version) - } - - fmt.Fprintf(w, "Usage: %s", p.config.Program) - - // write the option component of the usage message - for _, spec := range options { - // prefix with a space - fmt.Fprint(w, " ") - if !spec.required { - fmt.Fprint(w, "[") - } - fmt.Fprint(w, synopsis(spec, "--"+spec.long)) - if !spec.required { - fmt.Fprint(w, "]") - } - } - - // write the positional component of the usage message - for _, spec := range positionals { - // prefix with a space - fmt.Fprint(w, " ") - up := strings.ToUpper(spec.long) - if spec.multiple { - if !spec.required { - fmt.Fprint(w, "[") - } - fmt.Fprintf(w, "%s [%s ...]", up, up) - if !spec.required { - fmt.Fprint(w, "]") - } - } else { - fmt.Fprint(w, up) - } - } - fmt.Fprint(w, "\n") -} - -// WriteHelp writes the usage string followed by the full help string for each option -func (p *Parser) WriteHelp(w io.Writer) { - var positionals, options []*spec - for _, spec := range p.spec { - if spec.positional { - positionals = append(positionals, spec) - } else { - options = append(options, spec) - } - } - - if p.description != "" { - fmt.Fprintln(w, p.description) - } - p.WriteUsage(w) - - // write the list of positionals - if len(positionals) > 0 { - fmt.Fprint(w, "\nPositional arguments:\n") - for _, spec := range positionals { - left := " " + strings.ToUpper(spec.long) - fmt.Fprint(w, left) - if spec.help != "" { - if len(left)+2 < colWidth { - fmt.Fprint(w, strings.Repeat(" ", colWidth-len(left))) - } else { - fmt.Fprint(w, "\n"+strings.Repeat(" ", colWidth)) - } - fmt.Fprint(w, spec.help) - } - fmt.Fprint(w, "\n") - } - } - - // write the list of options - fmt.Fprint(w, "\nOptions:\n") - for _, spec := range options { - printOption(w, spec) - } - - // write the list of built in options - printOption(w, &spec{boolean: true, long: "help", short: "h", help: "display this help and exit"}) - if p.version != "" { - printOption(w, &spec{boolean: true, long: "version", help: "display version and exit"}) - } -} - -func printOption(w io.Writer, spec *spec) { - left := " " + synopsis(spec, "--"+spec.long) - if spec.short != "" { - left += ", " + synopsis(spec, "-"+spec.short) - } - fmt.Fprint(w, left) - if spec.help != "" { - if len(left)+2 < colWidth { - fmt.Fprint(w, strings.Repeat(" ", colWidth-len(left))) - } else { - fmt.Fprint(w, "\n"+strings.Repeat(" ", colWidth)) - } - fmt.Fprint(w, spec.help) - } - // If spec.dest is not the zero value then a default value has been added. - v := spec.dest - if v.IsValid() { - z := reflect.Zero(v.Type()) - if (v.Type().Comparable() && z.Type().Comparable() && v.Interface() != z.Interface()) || v.Kind() == reflect.Slice && !v.IsNil() { - if scalar, ok := v.Interface().(encoding.TextMarshaler); ok { - if value, err := scalar.MarshalText(); err != nil { - fmt.Fprintf(w, " [default: error: %v]", err) - } else { - fmt.Fprintf(w, " [default: %v]", string(value)) - } - } else { - fmt.Fprintf(w, " [default: %v]", v) - } - } - } - fmt.Fprint(w, "\n") -} - -func synopsis(spec *spec, form string) string { - if spec.boolean { - return form - } - return form + " " + strings.ToUpper(spec.long) -} diff --git a/vendor/github.com/alexflint/go-scalar/.gitignore b/vendor/github.com/alexflint/go-scalar/.gitignore deleted file mode 100644 index daf913b..0000000 --- a/vendor/github.com/alexflint/go-scalar/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/vendor/github.com/alexflint/go-scalar/.travis.yml b/vendor/github.com/alexflint/go-scalar/.travis.yml deleted file mode 100644 index d4e2c01..0000000 --- a/vendor/github.com/alexflint/go-scalar/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: go -go: - - tip -before_install: - - go get github.com/axw/gocov/gocov - - go get github.com/mattn/goveralls - - if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi -script: - - $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/vendor/github.com/alexflint/go-scalar/LICENSE b/vendor/github.com/alexflint/go-scalar/LICENSE deleted file mode 100644 index a50c494..0000000 --- a/vendor/github.com/alexflint/go-scalar/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2015, Alex Flint -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/vendor/github.com/alexflint/go-scalar/README.md b/vendor/github.com/alexflint/go-scalar/README.md deleted file mode 100644 index e6f510e..0000000 --- a/vendor/github.com/alexflint/go-scalar/README.md +++ /dev/null @@ -1,28 +0,0 @@ -[![GoDoc](https://godoc.org/github.com/alexflint/go-scalar?status.svg)](https://godoc.org/github.com/alexflint/go-scalar) -[![Build Status](https://travis-ci.org/alexflint/go-scalar.svg?branch=master)](https://travis-ci.org/alexflint/go-scalar) -[![Coverage Status](https://coveralls.io/repos/alexflint/go-scalar/badge.svg?branch=master&service=github)](https://coveralls.io/github/alexflint/go-scalar?branch=master) -[![Report Card](https://goreportcard.com/badge/github.com/alexflint/go-scalar)](https://goreportcard.com/badge/github.com/alexflint/go-scalar) - -## Scalar parsing library - -Scalar is a library for parsing strings into arbitrary scalars (integers, -floats, strings, booleans, etc). It is helpful for tasks such as parsing -strings passed as environment variables or command line arguments. - -```shell -go get github.com/alexflint/go-scalar -``` - -The main API works as follows: - -```go -var value int -err := scalar.Parse(&value, "123") -``` - -There is also a variant that takes a `reflect.Value`: - -```go -var value int -err := scalar.ParseValue(reflect.ValueOf(&value), "123") -``` diff --git a/vendor/github.com/alexflint/go-scalar/go.mod b/vendor/github.com/alexflint/go-scalar/go.mod deleted file mode 100644 index 6eea393..0000000 --- a/vendor/github.com/alexflint/go-scalar/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/alexflint/go-scalar - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.2.2 -) diff --git a/vendor/github.com/alexflint/go-scalar/go.sum b/vendor/github.com/alexflint/go-scalar/go.sum deleted file mode 100644 index e03ee77..0000000 --- a/vendor/github.com/alexflint/go-scalar/go.sum +++ /dev/null @@ -1,6 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= diff --git a/vendor/github.com/alexflint/go-scalar/scalar.go b/vendor/github.com/alexflint/go-scalar/scalar.go deleted file mode 100644 index 073392c..0000000 --- a/vendor/github.com/alexflint/go-scalar/scalar.go +++ /dev/null @@ -1,153 +0,0 @@ -// Package scalar parses strings into values of scalar type. - -package scalar - -import ( - "encoding" - "errors" - "fmt" - "net" - "net/mail" - "reflect" - "strconv" - "time" -) - -// The reflected form of some special types -var ( - textUnmarshalerType = reflect.TypeOf([]encoding.TextUnmarshaler{}).Elem() - durationType = reflect.TypeOf(time.Duration(0)) - mailAddressType = reflect.TypeOf(mail.Address{}) - macType = reflect.TypeOf(net.HardwareAddr{}) -) - -var ( - errNotSettable = errors.New("value is not settable") - errPtrNotSettable = errors.New("value is a nil pointer and is not settable") -) - -// Parse assigns a value to v by parsing s. -func Parse(dest interface{}, s string) error { - return ParseValue(reflect.ValueOf(dest), s) -} - -// ParseValue assigns a value to v by parsing s. -func ParseValue(v reflect.Value, s string) error { - // If we have a nil pointer then allocate a new object - if v.Kind() == reflect.Ptr && v.IsNil() { - if !v.CanSet() { - return errPtrNotSettable - } - - v.Set(reflect.New(v.Type().Elem())) - } - - // If it implements encoding.TextUnmarshaler then use that - if scalar, ok := v.Interface().(encoding.TextUnmarshaler); ok { - return scalar.UnmarshalText([]byte(s)) - } - // If it's a value instead of a pointer, check that we can unmarshal it - // via TextUnmarshaler as well - if v.CanAddr() { - if scalar, ok := v.Addr().Interface().(encoding.TextUnmarshaler); ok { - return scalar.UnmarshalText([]byte(s)) - } - } - - // If we have a pointer then dereference it - if v.Kind() == reflect.Ptr { - v = v.Elem() - } - - if !v.CanSet() { - return errNotSettable - } - - // Switch on concrete type - switch scalar := v.Interface(); scalar.(type) { - case time.Duration: - duration, err := time.ParseDuration(s) - if err != nil { - return err - } - v.Set(reflect.ValueOf(duration)) - return nil - case mail.Address: - addr, err := mail.ParseAddress(s) - if err != nil { - return err - } - v.Set(reflect.ValueOf(*addr)) - return nil - case net.HardwareAddr: - ip, err := net.ParseMAC(s) - if err != nil { - return err - } - v.Set(reflect.ValueOf(ip)) - return nil - } - - // Switch on kind so that we can handle derived types - switch v.Kind() { - case reflect.String: - v.SetString(s) - case reflect.Bool: - x, err := strconv.ParseBool(s) - if err != nil { - return err - } - v.SetBool(x) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - x, err := strconv.ParseInt(s, 10, v.Type().Bits()) - if err != nil { - return err - } - v.SetInt(x) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - x, err := strconv.ParseUint(s, 10, v.Type().Bits()) - if err != nil { - return err - } - v.SetUint(x) - case reflect.Float32, reflect.Float64: - x, err := strconv.ParseFloat(s, v.Type().Bits()) - if err != nil { - return err - } - v.SetFloat(x) - default: - return fmt.Errorf("cannot parse into %v", v.Type()) - } - return nil -} - -// CanParse returns true if the type can be parsed from a string. -func CanParse(t reflect.Type) bool { - // If it implements encoding.TextUnmarshaler then use that - if t.Implements(textUnmarshalerType) || reflect.PtrTo(t).Implements(textUnmarshalerType) { - return true - } - - // If we have a pointer then dereference it - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - - // Check for other special types - switch t { - case durationType, mailAddressType, macType: - return true - } - - // Fall back to checking the kind - switch t.Kind() { - case reflect.Bool: - return true - case reflect.String, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, - reflect.Float32, reflect.Float64: - return true - } - return false -} diff --git a/vendor/github.com/godbus/dbus/.travis.yml b/vendor/github.com/godbus/dbus/.travis.yml deleted file mode 100644 index 9cd57f4..0000000 --- a/vendor/github.com/godbus/dbus/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -dist: precise -language: go -go_import_path: github.com/godbus/dbus -sudo: true - -go: - - 1.7.3 - - 1.8.7 - - 1.9.5 - - 1.10.1 - - tip - -env: - global: - matrix: - - TARGET=amd64 - - TARGET=arm64 - - TARGET=arm - - TARGET=386 - - TARGET=ppc64le - -matrix: - fast_finish: true - allow_failures: - - go: tip - exclude: - - go: tip - env: TARGET=arm - - go: tip - env: TARGET=arm64 - - go: tip - env: TARGET=386 - - go: tip - env: TARGET=ppc64le - -addons: - apt: - packages: - - dbus - - dbus-x11 - -before_install: - -script: - - go test -v -race ./... # Run all the tests with the race detector enabled - - go vet ./... # go vet is the official Go static analyzer diff --git a/vendor/github.com/godbus/dbus/CONTRIBUTING.md b/vendor/github.com/godbus/dbus/CONTRIBUTING.md deleted file mode 100644 index c88f9b2..0000000 --- a/vendor/github.com/godbus/dbus/CONTRIBUTING.md +++ /dev/null @@ -1,50 +0,0 @@ -# How to Contribute - -## Getting Started - -- Fork the repository on GitHub -- Read the [README](README.markdown) for build and test instructions -- Play with the project, submit bugs, submit patches! - -## Contribution Flow - -This is a rough outline of what a contributor's workflow looks like: - -- Create a topic branch from where you want to base your work (usually master). -- Make commits of logical units. -- Make sure your commit messages are in the proper format (see below). -- Push your changes to a topic branch in your fork of the repository. -- Make sure the tests pass, and add any new tests as appropriate. -- Submit a pull request to the original repository. - -Thanks for your contributions! - -### Format of the Commit Message - -We follow a rough convention for commit messages that is designed to answer two -questions: what changed and why. The subject line should feature the what and -the body of the commit should describe the why. - -``` -scripts: add the test-cluster command - -this uses tmux to setup a test cluster that you can easily kill and -start for debugging. - -Fixes #38 -``` - -The format can be described more formally as follows: - -``` -: - - - -