~emersion/drmdb

34c977249cd29dc5a0a9da16f28517f9f58989c9 — Simon Ser 21 days ago 625bfac
drmdoc: use go/format to format generated files
2 files changed, 7 insertions(+), 2 deletions(-)

M drmdoc/drmdoc.go
M drmdoc/generate.go
M drmdoc/drmdoc.go => drmdoc/drmdoc.go +0 -1
@@ 7,7 7,6 @@ package drmdoc
//go:generate go run generate.go drivers/gpu/drm/drm_color_mgmt.c "overview" "color management properties"
//go:generate go run generate.go drivers/gpu/drm/drm_atomic_uapi.c "explicit fencing properties"
//go:generate go run generate.go drivers/gpu/drm/drm_connector.c "Variable refresh properties"
//go:generate go fmt

import (
	"git.sr.ht/~emersion/go-drm"

M drmdoc/generate.go => drmdoc/generate.go +7 -1
@@ 8,6 8,7 @@ import (
	"fmt"
	"log"
	"net/http"
	"go/format"
	"os"
	"strings"
	"unicode"


@@ 155,13 156,18 @@ var ` + symbol + ` = map[string]string{

	out.WriteString("}\n")

	b, err := format.Source(out.Bytes())
	if err != nil {
		log.Fatal(err)
	}

	f, err := os.Create(titleToFilename(outTitle) + ".go")
	if err != nil {
		log.Fatal(err)
	}
	defer f.Close()

	if _, err := f.Write(out.Bytes()); err != nil {
	if _, err := f.Write(b); err != nil {
		log.Fatal(err)
	}
	if err := f.Close(); err != nil {