You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
make sure go is installed correctly by executing go version. Make sure to open a new terminal, so the updated path can be loaded :)
create a new folder and place this compress.go script inside:
package main
import (
"fmt""log""github.com/yani-/wpress"
)
funcmain() {
// Define the output .wpress filearchiveFilename:="output.wpress"// Create a new Writer instancewriter, err:=wpress.NewWriter(archiveFilename)
iferr!=nil {
log.Fatalf("Failed to create archive: %v", err)
}
folderToCompress:="/path/to/directory/to/add"// Add folder to the archiveerr=writer.AddDirectory(folderToCompress)
iferr!=nil {
log.Fatalf("Failed to add file to archive: %v", err)
}
// Close the writer to finalize the archiveerr=writer.Close()
iferr!=nil {
log.Fatalf("Failed to close archive: %v", err)
}
fmt.Printf("Folder %s successfully compressed into %s\n", folderToCompress, archiveFilename)
}
I installed go, I used GET to download the files from GIT, but when I use BUILD I can't turn the package in something executable. How do I use this?
The text was updated successfully, but these errors were encountered: