test_env: hardcode major go version in use (#23464)

hardcode the version of test_env we use in docker, so that we can use
different major versions of golang between versions of Gitea

---------

Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
techknowlogick 2023-03-14 16:09:01 -04:00 committed by GitHub
parent 6e75739c5b
commit 32204fcf8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 23 deletions

View file

@ -36,6 +36,8 @@ var (
once sync.Once
cache *lru.TwoQueueCache
githubStyles = styles.Get("github")
)
// NewContext loads custom highlight map from local config
@ -121,7 +123,7 @@ func CodeFromLexer(lexer chroma.Lexer, code string) string {
return code
}
// style not used for live site but need to pass something
err = formatter.Format(htmlw, styles.GitHub, iterator)
err = formatter.Format(htmlw, githubStyles, iterator)
if err != nil {
log.Error("Can't format code: %v", err)
return code
@ -184,7 +186,7 @@ func File(fileName, language string, code []byte) ([]string, string, error) {
lines := make([]string, 0, len(tokensLines))
for _, tokens := range tokensLines {
iterator = chroma.Literator(tokens...)
err = formatter.Format(htmlBuf, styles.GitHub, iterator)
err = formatter.Format(htmlBuf, githubStyles, iterator)
if err != nil {
return nil, "", fmt.Errorf("can't format code: %w", err)
}