Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
MetalBlueberry committed May 25, 2024
1 parent b95b94d commit b0c12cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion generator/cmd/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func generatePackage(projectRoot, schema, versionOutput, cdnUrl, tag string, cle
}

// plot_gen.go must be separate in an offline package
err = r.CreatePlotGo(offlineOuput, versionOutput, cdnUrl, tag)
err = r.CreatePlotGo(offlineOuput, versionOutput, cdnUrl)
if err != nil {
log.Fatalf("unable to write plot.go, %s", err)
}
Expand Down
10 changes: 3 additions & 7 deletions generator/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ func NewRenderer(fs Creator, root *Root) (*Renderer, error) {

var doNotEdit = "// Code generated by go-plotly/generator. DO NOT EDIT."

func (r *Renderer) CreatePlotGo(dir, graphObjectsImportPath, cdnUrl, tag string) error {
func (r *Renderer) CreatePlotGo(dir string, graphObjectsImportPath string, cdnUrl string) error {
src := &bytes.Buffer{}
err := r.WritePlotGo(src, graphObjectsImportPath, cdnUrl, tag)
err := r.WritePlotGo(src, graphObjectsImportPath, cdnUrl)

if err != nil {
return err
Expand Down Expand Up @@ -111,17 +111,13 @@ const generationTemplate = `
`

// WritePlotly writes the base plotly file
func (r *Renderer) WritePlotGo(w io.Writer, graphObjectsImportPath string, cdnUrl string, tag string) error {
func (r *Renderer) WritePlotGo(w io.Writer, graphObjectsImportPath string, cdnUrl string) error {
// inject the basehtml with the correct plotly cdn reference
data := struct {
CDN string
Template string
Tag string
GraphObjectsImportPath string
}{
CDN: cdnUrl,
Template: fmt.Sprintf("fmt.Sprintf(`%s`, head)", generationTemplate),
Tag: tag,
GraphObjectsImportPath: graphObjectsImportPath,
}

Expand Down

0 comments on commit b0c12cd

Please sign in to comment.