golang/go · error

errLongName

errLongName

Error message

zip: FileHeader.Name too long

What it means

Error "zip: FileHeader.Name too long" thrown in golang/go.

Source

Thrown at src/archive/zip/writer.go:20

// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package zip

import (
	"bufio"
	"encoding/binary"
	"errors"
	"hash"
	"hash/crc32"
	"io"
	"io/fs"
	"strings"
	"unicode/utf8"
)

var (
	errLongName  = errors.New("zip: FileHeader.Name too long")
	errLongExtra = errors.New("zip: FileHeader.Extra too long")
)

// Writer implements a zip file writer.
type Writer struct {
	cw          *countWriter
	dir         []*header
	last        *fileWriter
	closed      bool
	compressors map[uint16]Compressor
	comment     string

	// testHookCloseSizeOffset if non-nil is called with the size
	// of offset of the central directory at Close.
	testHookCloseSizeOffset func(size, offset uint64)
}

type header struct {

View on GitHub (pinned to b6b368adc5)

When it happens

Trigger: Thrown at src/archive/zip/writer.go:20 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12). Data as JSON: /api/errors/5d999ec459c14b61. Report an issue: GitHub.