Skip to content

Commit

Permalink
Remove embed-syso feature
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertJohan committed Dec 16, 2020
1 parent 3f72e1a commit 0634379
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 229 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -4,5 +4,4 @@
/rice/rice.exe

*.rice-box.go
*.rice-box.syso
.wercker
13 changes: 0 additions & 13 deletions README.md
Expand Up @@ -90,19 +90,6 @@ go build

*A Note on Symbolic Links*: `embed-go` uses the `os.Walk` function from the standard library. The `os.Walk` function does **not** follow symbolic links. When creating a box, be aware that any symbolic links inside your box's directory are not followed. When the box itself is a symbolic link, the rice tool resolves its actual location before adding the contents.

### `rice embed-syso`: Embed resources by generating a coff .syso file and some .go source code

** This method is experimental. Do not use for production systems. **

Execute this method before building. It generates a COFF .syso file and Go source file. The Go compiler then compiles these files into the binary.

Execute the following commands:

```bash
rice embed-syso
go build
```

### `rice append`: Append resources to executable as zip file

This method changes an already built executable. It appends the resources as zip file to the binary. It makes compilation a lot faster. Using the append method works great for adding large assets to an executable binary.
Expand Down
3 changes: 1 addition & 2 deletions embedded/embedded.go
Expand Up @@ -9,8 +9,7 @@ import (
)

const (
EmbedTypeGo = 0
EmbedTypeSyso = 1
EmbedTypeGo = 0
)

// EmbeddedBox defines an embedded box
Expand Down
2 changes: 1 addition & 1 deletion rice/embed-go_test.go
Expand Up @@ -86,7 +86,7 @@ func main() {
[]byte("Fasttemplate double escaping"),
},
}
withIgnoredFiles := append(sourceFiles, sourceFile{"foo/rice-box.go", []byte("package main\nfunc init() {\n}")}, sourceFile{"foo/_amd64.rice-box.syso", []byte{}})
withIgnoredFiles := append(sourceFiles, sourceFile{"foo/rice-box.go", []byte("package main\nfunc init() {\n}")})
pkg, cleanup, err := setUpTestPkg("foobar", withIgnoredFiles)
defer cleanup()
if err != nil {
Expand Down
206 changes: 0 additions & 206 deletions rice/embed-syso.go

This file was deleted.

2 changes: 1 addition & 1 deletion rice/flags.go
Expand Up @@ -20,7 +20,7 @@ var flags struct {
} `command:"append"`

EmbedGo struct{} `command:"embed-go" alias:"embed"`
EmbedSyso struct{} `command:"embed-syso"`
EmbedSyso struct{} `command:"embed-syso" hidden:"true"`
Clean struct{} `command:"clean"`

Tags []string `long:"tags" description:"Tags to use with the implicit go build"`
Expand Down
3 changes: 0 additions & 3 deletions rice/main.go
Expand Up @@ -38,9 +38,6 @@ func main() {
case "embed-syso":
log.Println("WARNING: embedding .syso is experimental..")
log.Fatalln("FATAL: embed-syso is broken and will remain unusable until further notice. Please see https://github.com/GeertJohan/go.rice/issues/162")
// for _, pkg := range pkgs {
// operationEmbedSyso(pkg)
// }
case "append":
operationAppend(pkgs)
case "clean":
Expand Down
3 changes: 1 addition & 2 deletions rice/util.go
Expand Up @@ -10,8 +10,7 @@ import (
// generated tests if a filename was generated by rice
func generated(filename string) bool {
return filepath.Base(filename) == boxFilename ||
strings.HasSuffix(filename, "."+boxFilename) ||
strings.HasSuffix(filename, sysoBoxSuffix)
strings.HasSuffix(filename, "."+boxFilename)
}

// randomString generates a pseudo-random alpha-numeric string with given length.
Expand Down

0 comments on commit 0634379

Please sign in to comment.