Store build cache fails with env var for Go version, bug

travis yaml snippet

language: go

go:
  - $TRAVIS_GO_VERSION

cache:
  directories:
    - $GOPATH/pkg/mod/cache/download
  timeout: 3600 # 1 hour

TRAVIS_GO_VERSION is defined in the travis job setting as 1.19.7

Job log snippets:

export TRAVIS_GO_VERSION=1.19.7

$ travis_setup_go
go version go1.19.7 linux/amd64
$ export GOPATH="/home/travis/gopath"

Setting up build cache
$ export CASHER_DIR=${TRAVIS_HOME}/.casher
0.06s$ Installing caching utilities
0.01s1.88sattempting to download cache archive
fetching PR.1658/cache-linux-trusty-304be2bdf2cc181ad8beef025955f3335a98b9504293d3dee8baedcb4c9554b8--go-$TRAVIS_GO_VERSION.tgz
fetching PR.1658/cache--go-$TRAVIS_GO_VERSION.tgz
fetching master/cache-linux-trusty-304be2bdf2cc181ad8beef025955f3335a98b9504293d3dee8baedcb4c9554b8--go-$TRAVIS_GO_VERSION.tgz
fetching master/cache--go-$TRAVIS_GO_VERSION.tgz
could not download cache
0.01s1.72sadding /home/travis/gopath/pkg/mod/cache/download to cache
creating directory /home/travis/gopath/pkg/mod/cache/download

store build cache
changes detected, packing new archive
uploading PR.1658/cache-linux-trusty-be2bdf2cc181ad8beef025955f3335a98b9504293d3dee8baedcb4c9554b8--go-$TRAVIS_GO_VERSION.tgz

failed to upload cache

curl: (22) The requested URL returned error: 403 Forbidden

The rest of Go lang support (travis_setup_go) works as expected with version 1.19.7 being installed and used.
This looks like a bug here: travis-build/base.rb at master · travis-ci/travis-build · GitHub
The code does not handle env var resolution within the urls.