Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request #91 from shurcooL/try-using-vfsgen-binary
Browse files Browse the repository at this point in the history
Replace data_generate.go with a proposed use of vfsgen binary.
  • Loading branch information
slimsag committed Jan 11, 2016
2 parents 068118e + 2d3831a commit 84f0569
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
9 changes: 4 additions & 5 deletions traceapp/tmpl/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ import (
"go/build"
"log"
"net/http"
"path/filepath"
)

func defaultBase(path string) string {
p, err := build.Import(path, "", build.FindOnly)
func importPathToDir(importPath string) string {
p, err := build.Import(importPath, "", build.FindOnly)
if err != nil {
log.Fatal(err)
log.Fatalln(err)
}
return p.Dir
}

// Data is a virtual filesystem that contains template data used by Appdash.
var Data = http.Dir(filepath.Join(defaultBase("sourcegraph.com/sourcegraph/appdash/traceapp/tmpl"), "data"))
var Data = http.Dir(importPathToDir("sourcegraph.com/sourcegraph/appdash/traceapp/tmpl/data"))
21 changes: 0 additions & 21 deletions traceapp/tmpl/data_generate.go

This file was deleted.

2 changes: 1 addition & 1 deletion traceapp/tmpl/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// This package needs to be go generated after making changes to template files.
package tmpl

//go:generate go run -tags=dev data_generate.go
//go:generate vfsgendev -source="sourcegraph.com/sourcegraph/appdash/traceapp/tmpl".Data

0 comments on commit 84f0569

Please sign in to comment.