~emersion/drmdb

aea2c3a0d92929082e59276680104fe0cc5cba50 — Simon Ser 20 days ago df9bdc1
go fmt
3 files changed, 15 insertions(+), 15 deletions(-)

M database/db.go
M drmtree/drmtree.go
M server.go
M database/db.go => database/db.go +1 -1
@@ 84,7 84,7 @@ func Store(n *drmtree.Node) (string, error) {
}

func Load(k string) (*drmtree.Node, error) {
	p := filepath.Join(Dir, k + ".json")
	p := filepath.Join(Dir, k+".json")
	f, err := os.Open(p)
	if err != nil {
		return nil, err

M drmtree/drmtree.go => drmtree/drmtree.go +2 -2
@@ 424,7 424,7 @@ func (m *PropertyMap) FormatTree(tf treefmt.Formatter) {
			attrs = append(attrs, "immutable")
		}
		if len(attrs) > 0 {
			s += " (" + strings.Join(attrs, ", ") +")"
			s += " (" + strings.Join(attrs, ", ") + ")"
		}

		s += ": " + prop.Type.String()


@@ 616,7 616,7 @@ func (plane *Plane) InFormats() []PlaneInFormatsModifier {
	return []PlaneInFormatsModifier{
		{
			Modifier: 0, // linear
			Formats: plane.Formats,
			Formats:  plane.Formats,
		},
	}
}

M server.go => server.go +12 -12
@@ 74,7 74,7 @@ func New() *echo.Echo {
	}

	e.GET("/", func(c echo.Context) error {
		return c.Render(http.StatusOK, "index.html", struct{
		return c.Render(http.StatusOK, "index.html", struct {
			Host string
		}{c.Request().Host})
	})


@@ 140,8 140,8 @@ func New() *echo.Echo {
		var devices []deviceData
		err := walkLatest(walkLatestDevice, func(k string, n *drmtree.Node) error {
			data := deviceData{
				Key: k,
				BusID: n.Device.BusID(),
				Key:     k,
				BusID:   n.Device.BusID(),
				BusType: n.Device.BusType,
				Driver:  n.Driver.Name,
			}


@@ 202,7 202,7 @@ func New() *echo.Echo {
				}

				altDevices = append(altDevices, altDeviceData{
					Key: k,
					Key:    k,
					Driver: alt.Driver,
				})
				return nil


@@ 307,7 307,7 @@ func New() *echo.Echo {
		}
		propertyName := c.Param("name")

		found := false;
		found := false
		var property drmtree.Property

		drivers := make(map[string]bool)


@@ 355,9 355,9 @@ func New() *echo.Echo {
		}
		type formatData struct {
			Modifier drm.Modifier
			Format drm.Format
			Planes map[drm.PlaneType]int
			Drivers map[string]int
			Format   drm.Format
			Planes   map[drm.PlaneType]int
			Drivers  map[string]int
		}

		planeFilter := -1


@@ 405,9 405,9 @@ func New() *echo.Echo {
						if _, ok := formats[k]; !ok {
							formats[k] = formatData{
								Modifier: mod.Modifier,
								Format: fmt,
								Planes: make(map[drm.PlaneType]int),
								Drivers: make(map[string]int),
								Format:   fmt,
								Planes:   make(map[drm.PlaneType]int),
								Drivers:  make(map[string]int),
							}
						}



@@ 430,7 430,7 @@ func New() *echo.Echo {
		}

		return c.Render(http.StatusOK, "formats.html", struct {
			Planes map[drm.PlaneType]int
			Planes  map[drm.PlaneType]int
			Drivers map[string]int
			Formats map[modifierAndFormat]formatData
		}{planes, drivers, formats})