From a1ea6c775ac230bb1a1428bb96e4306044aa944b Mon Sep 17 00:00:00 2001 From: Gary Willoughby Date: Sat, 19 Dec 2020 13:26:53 +0000 Subject: [PATCH] Updated for Go v1.16 beta1 --- file/mod.go | 42 ++++++++++++++++++++++++++---------------- go.mod | 2 +- go.sum | 0 3 files changed, 27 insertions(+), 17 deletions(-) delete mode 100644 go.sum diff --git a/file/mod.go b/file/mod.go index 1611bf9..bacc022 100644 --- a/file/mod.go +++ b/file/mod.go @@ -9,10 +9,11 @@ import ( // ParseModJSON parses the mode file into a data structure. func ParseModJSON(raw string) GoMod { data := GoMod{ - Module: module{}, - Require: make([]require, 0, 10), - Exclude: make([]module, 0, 10), - Replace: make([]replace, 0, 10), + Module: Module{}, + Require: make([]Require, 0, 10), + Exclude: make([]Module, 0, 10), + Replace: make([]Replace, 0, 10), + Retract: make([]Retract, 0, 10), } err := json.Unmarshal([]byte(raw), &data) @@ -23,27 +24,36 @@ func ParseModJSON(raw string) GoMod { // GoMod represents parsed module json data. type GoMod struct { - Module module - Require []require - Exclude []module - Replace []replace + Module Module + Go string + Require []Require + Exclude []Module + Replace []Replace + Retract []Retract } -// module represents parsed module json data. -type module struct { +// Module represents parsed module json data. +type Module struct { Path string Version string } -// require represents parsed module json data. -type require struct { +// Require represents parsed module json data. +type Require struct { Path string Version string Indirect bool } -// replace represents parsed module json data. -type replace struct { - Old module - New module +// Replace represents parsed module json data. +type Replace struct { + Old Module + New Module +} + +// Retract represents dependency version that are retracted. +type Retract struct { + Low string + High string + Rationale string } diff --git a/go.mod b/go.mod index a5477b8..6a52052 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/nomad-software/vend -go 1.15 +go 1.16 diff --git a/go.sum b/go.sum deleted file mode 100644 index e69de29..0000000