Skip to content

Commit

Permalink
gofmt -s
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Jul 18, 2023
1 parent 4c365e0 commit 3d8dbde
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 21 deletions.
1 change: 1 addition & 0 deletions cmd/pdftext/conv.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//go:build exclude

package main

import (
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdftext/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func getObjects(pdf *pdfReader, page int) ([]string, []interface{}) {
resources, _ := pdf.GetDict(dict["Resources"])
xobjects, _ := pdf.GetDict(resources["XObject"])
xnames := []string{}
for name, _ := range xobjects {
for name := range xobjects {
xnames = append(xnames, name)
}
sort.Strings(xnames)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pdftext/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (w *pdfWriter) Close() error {
maxObj = ref[0]
}
}
for ref, _ := range w.objects {
for ref := range w.objects {
if maxObj < ref[0] {
maxObj = ref[0]
}
Expand Down
2 changes: 1 addition & 1 deletion examples/html-canvas/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build js
//go:build js

package main

Expand Down
2 changes: 1 addition & 1 deletion examples/html-canvas/serve.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !js
//go:build !js

package main

Expand Down
2 changes: 1 addition & 1 deletion examples/opengl/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build cgo
//go:build cgo

package main

Expand Down
2 changes: 1 addition & 1 deletion font/sfnt_cff.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (cff *cffTable) ToPath(p Pather, glyphID, ppem uint16, x0, y0, f float64, h
b1 := int32(r.ReadUint8())
v = (-(b0-251)*256 - b1 - 108) << 16
} else {
v = r.ReadInt32() // less-siginificant bits is fraction
v = r.ReadInt32() // least-significant bits are fraction
}
if cff.version == 1 && 48 <= len(stack) || cff.version == 2 && 513 <= len(stack) {
return fmt.Errorf("%v: too many operands for operator", table)
Expand Down
13 changes: 7 additions & 6 deletions latex_bin.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build latex
//go:build latex

package canvas

Expand All @@ -25,11 +25,12 @@ var tempDir = path.Join(os.TempDir(), "tdewolff-canvas")

// ParseLaTeX parses a LaTeX formatted string into a path. It requires latex and dvisvgm to be installed on the machine.
// The content is surrounded by:
// \documentclass{article}
// \begin{document}
// \thispagestyle{empty}
// {{input}}
// \end{document}
//
// \documentclass{article}
// \begin{document}
// \thispagestyle{empty}
// {{input}}
// \end{document}
func ParseLaTeX(s string) (*Path, error) {
if err := os.MkdirAll(tempDir, os.ModePerm); err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion latex_bin_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build latex
//go:build latex

package canvas

Expand Down
2 changes: 1 addition & 1 deletion renderers/htmlcanvas/htmlcanvas.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build js
//go:build js

package htmlcanvas

Expand Down
2 changes: 1 addition & 1 deletion renderers/opengl/opengl.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build cgo
//go:build cgo

package opengl

Expand Down
2 changes: 0 additions & 2 deletions resources/preview/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build harfbuzz

package main

import (
Expand Down
2 changes: 1 addition & 1 deletion text/fribidi.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !fribidi js
//go:build !fribidi || js

package text

Expand Down
2 changes: 1 addition & 1 deletion text/fribidi_cgo.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build fribidi,!js
//go:build fribidi && !js

package text

Expand Down
1 change: 0 additions & 1 deletion text/harfbuzz.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !harfbuzz || js
// +build !harfbuzz js

package text

Expand Down
2 changes: 1 addition & 1 deletion text/harfbuzz_cgo.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build harfbuzz,!js
//go:build harfbuzz && !js

package text

Expand Down

0 comments on commit 3d8dbde

Please sign in to comment.