github.com/hashicorp/packer@v1.14.3/post-processor/compress/tar_fix_go110.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  //go:build go1.10
     5  // +build go1.10
     6  
     7  package compress
     8  
     9  import (
    10  	"archive/tar"
    11  	"time"
    12  )
    13  
    14  func setHeaderFormat(header *tar.Header) {
    15  	// We have to set the Format explicitly for the googlecompute-import
    16  	// post-processor. Google Cloud only allows importing GNU tar format.
    17  	header.Format = tar.FormatGNU
    18  	header.AccessTime = time.Time{}
    19  	header.ModTime = time.Time{}
    20  	header.ChangeTime = time.Time{}
    21  }