]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
all: Format files with gofmt
authorOleksandr Redko <Oleksandr_Redko@epam.com>
Wed, 4 Oct 2023 19:25:43 +0000 (22:25 +0300)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 5 Oct 2023 12:45:55 +0000 (14:45 +0200)
commands/server.go
common/paths/url.go
tpl/math/round.go
tpl/tplimpl/template_ast_transformers.go

index 364e59f8ff345052906df736f049e6bb34b78a67..63c09fccd50868661930902491944a62871e651c 100644 (file)
@@ -927,7 +927,7 @@ func (c *serverCommand) serve() error {
 
        for i := range baseURLs {
                mu, listener, serverURL, endpoint, err := srv.createEndpoint(i)
-               var srv *http.Server    
+               var srv *http.Server
                if c.tlsCertFile != "" && c.tlsKeyFile != "" {
                        srv = &http.Server{
                                Addr:    endpoint,
index c538d8f2cbe20264748420010d1a7916189baf01..cefefdf11b7b0fdb22c9ba4173c5d0645aaa31b3 100644 (file)
@@ -51,9 +51,10 @@ var pb pathBridge
 
 // MakePermalink combines base URL with content path to create full URL paths.
 // Example
-//    base:   http://spf13.com/
-//    path:   post/how-i-blog
-//    result: http://spf13.com/post/how-i-blog
+//
+//     base:   http://spf13.com/
+//     path:   post/how-i-blog
+//     result: http://spf13.com/post/how-i-blog
 func MakePermalink(host, plink string) *url.URL {
        base, err := url.Parse(host)
        if err != nil {
@@ -117,17 +118,19 @@ func PrettifyURL(in string) string {
 
 // PrettifyURLPath takes a URL path to a content and converts it
 // to enable pretty URLs.
-//     /section/name.html       becomes /section/name/index.html
-//     /section/name/           becomes /section/name/index.html
-//     /section/name/index.html becomes /section/name/index.html
+//
+//     /section/name.html       becomes /section/name/index.html
+//     /section/name/           becomes /section/name/index.html
+//     /section/name/index.html becomes /section/name/index.html
 func PrettifyURLPath(in string) string {
        return prettifyPath(in, pb)
 }
 
 // Uglify does the opposite of PrettifyURLPath().
-//     /section/name/index.html becomes /section/name.html
-//     /section/name/           becomes /section/name.html
-//     /section/name.html       becomes /section/name.html
+//
+//     /section/name/index.html becomes /section/name.html
+//     /section/name/           becomes /section/name.html
+//     /section/name.html       becomes /section/name.html
 func Uglify(in string) string {
        if path.Ext(in) == "" {
                if len(in) < 2 {
index 9b33120af9d0a7e21b04a4b00a5ad2171c6ae9f3..e2b5057e0e16ec9a36ef2ec259bc0cb0f78af2e2 100644 (file)
@@ -20,19 +20,20 @@ const (
 // Round returns the nearest integer, rounding half away from zero.
 //
 // Special cases are:
+//
 //     Round(±0) = ±0
 //     Round(±Inf) = ±Inf
 //     Round(NaN) = NaN
 func _round(x float64) float64 {
        // Round is a faster implementation of:
        //
-       // func Round(x float64) float64 {
-       //   t := Trunc(x)
-       //   if Abs(x-t) >= 0.5 {
-       //     return t + Copysign(1, x)
-       //   }
-       //   return t
-       // }
+       //      func Round(x float64) float64 {
+       //              t := Trunc(x)
+       //              if Abs(x-t) >= 0.5 {
+       //                      return t + Copysign(1, x)
+       //              }
+       //              return t
+       //      }
        const (
                signMask = 1 << 63
                fracMask = 1<<shift - 1
index bc02d93ac35d756fb1aa6d1ec17a080e2d1ca59d..8d5d8d1b3bc2a3412f6c0282f09866da23eb9b31 100644 (file)
@@ -213,7 +213,8 @@ func (c *templateContext) hasIdent(idents []string, ident string) bool {
 // collectConfig collects and parses any leading template config variable declaration.
 // This will be the first PipeNode in the template, and will be a variable declaration
 // on the form:
-//    {{ $_hugo_config:= `{ "version": 1 }` }}
+//
+//     {{ $_hugo_config:= `{ "version": 1 }` }}
 func (c *templateContext) collectConfig(n *parse.PipeNode) {
        if c.t.typ != templateShortcode {
                return