Skip to content

Commit

Permalink
content/static: generate constant 2019 copyright year
Browse files Browse the repository at this point in the history
The generated static.go file was created in 2019 in CL 156321, and
it inherited the generator code from x/tools that uses today's year.
There isn't a need to update the copyright year, so make it a constant.

This change fixes the failing TestStaticIsUpToDate test in 2020,
and prevents it from breaking in every future year.

Fixes golang/go#36360
Updates golang/go#11811

Change-Id: Ie87b1219448f1e288539f95280492b4f95b76798
Reviewed-on: https://go-review.googlesource.com/c/website/+/213121
Run-TryBot: Dmitri Shuralyov <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Rebecca Stambler <[email protected]>
  • Loading branch information
dmitshur committed Jan 2, 2020
1 parent 3c8b7f9 commit 058dd16
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions content/static/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"fmt"
"go/format"
"io/ioutil"
"time"
"unicode"
)

Expand Down Expand Up @@ -106,6 +105,6 @@ func appendQuote(out *bytes.Buffer, data []byte) {

const warning = `// Code generated by "makestatic"; DO NOT EDIT.`

var license = fmt.Sprintf(`// Copyright %d The Go Authors. All rights reserved.
const license = `// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.`, time.Now().UTC().Year())
// license that can be found in the LICENSE file.`

0 comments on commit 058dd16

Please sign in to comment.