Standard library / archive/tar
archive/tar.ErrInsecurePath
Non-local archive entry name warning when tarinsecurepath=0; reject it and apply additional path and type checks. This example classifies a wrapped sentinel. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
var ErrInsecurePath errorWorking Example
Example Snippetgo
package main
import ( "archive/tar" "errors" "fmt")
func must(e error) { if e != nil { panic(e) }}
func main() { e := fmt.Errorf("archive: %w", tar.ErrInsecurePath) fmt.Println(errors.Is(e, tar.ErrInsecurePath))}