From c47212f6f0f9f75a23516f7a938ff23dd00dc110 Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Tue, 1 May 2018 12:23:54 -0400 Subject: [PATCH] godoc: don't exclude version field from File struct When uploading a new release, it deserializes the payload into a File struct for processing. It needs the Version field to determine which release it's in. Change-Id: I171f416dbb1b1b6c354948ea9a31b9c8694f892e Reviewed-on: https://go-review.googlesource.com/110627 Run-TryBot: Andrew Bonventre Reviewed-by: Bryan C. Mills Reviewed-by: Brad Fitzpatrick Reviewed-by: Filippo Valsorda --- godoc/dl/dl.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/godoc/dl/dl.go b/godoc/dl/dl.go index f5e6320874..7696f0883c 100644 --- a/godoc/dl/dl.go +++ b/godoc/dl/dl.go @@ -27,7 +27,6 @@ import ( "time" "golang.org/x/net/context" - "google.golang.org/appengine" "google.golang.org/appengine/datastore" "google.golang.org/appengine/log" @@ -47,11 +46,13 @@ func RegisterHandlers(mux *http.ServeMux) { mux.HandleFunc("/dl/init", initHandler) } +// File represents a file on the golang.org downloads page. +// It should be kept in sync with the upload code in x/build/cmd/release. type File struct { Filename string `json:"filename"` OS string `json:"os"` Arch string `json:"arch"` - Version string `json:"-"` + Version string `json:"version"` Checksum string `json:"-" datastore:",noindex"` // SHA1; deprecated ChecksumSHA256 string `json:"sha256" datastore:",noindex"` Size int64 `json:"size" datastore:",noindex"`