pixy icon indicating copy to clipboard operation
pixy copied to clipboard

Output components has error

Open dejurin opened this issue 6 years ago • 0 comments

package main

import (
	"fmt"
	"io/ioutil"
	"github.com/aerogo/pixy"
	"github.com/aerogo/aero"
	
)

func main() {
	app := aero.New()
	configure(app).Run()
}

func configure(app *aero.Application) *aero.Application {
	app.Get("/", func(ctx aero.Context) error {
		
		src, _ := ioutil.ReadFile("../components/t.pixy")

		components, err := pixy.CompileBytes(src)

			if err != nil {
				panic(err)
				fmt.Println("error")
			}

			return  ctx.HTML(components.Code);
	})

	return app
}

Output:

go build
# example.com/cc
./main.go:28:33: components.Code undefined (type []*pixy.Component has no field or method Code)
156 ms
exit status 2

Help please, started learn great framework but more thing not understand cuz not have examples.

dejurin avatar Dec 27 '19 07:12 dejurin