Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
crhntr committed Oct 22, 2024
1 parent 3416a35 commit aa9028f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/source/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (imports *Imports) AddNetHTTP() string { return imports.Add("", "net/h
func (imports *Imports) AddHTMLTemplate() string { return imports.Add("", "html/template") }
func (imports *Imports) AddContext() string { return imports.Add("", "context") }

func (imports *Imports) HTTPErrorCall(response ast.Expr, message ast.Expr, code int) *ast.CallExpr {
func (imports *Imports) HTTPErrorCall(response, message ast.Expr, code int) *ast.CallExpr {
return imports.Call("", "net/http", "Error", []ast.Expr{
response,
message,
Expand Down
4 changes: 1 addition & 3 deletions internal/source/reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ package source

import "testing"

func TestParseStringWithType(t *testing.T) {

}
func TestParseStringWithType(t *testing.T) {}
5 changes: 3 additions & 2 deletions internal/source/template_test.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package source_test

import (
"github.com/stretchr/testify/assert"
"go/ast"
"go/parser"
"go/token"
"golang.org/x/tools/go/packages"
"log"
"os"
"path/filepath"
"slices"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"golang.org/x/tools/go/packages"
"golang.org/x/tools/txtar"

"github.com/crhntr/muxt/internal/source"
Expand Down
1 change: 1 addition & 0 deletions name.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ func parseHandler(fileSet *token.FileSet, def *TemplateName, pathParameterNames
def.call = call
return nil
}

func (tn TemplateName) callWriteHeader(receiverInterfaceType *ast.InterfaceType) bool {
if tn.call == nil {
return true
Expand Down
3 changes: 2 additions & 1 deletion routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,8 @@ func executeFuncDecl(imports *source.Imports, templatesVariableIdent string) *as
Fun: &ast.SelectorExpr{X: ast.NewIdent(httpResponseField(imports).Names[0].Name), Sel: ast.NewIdent("WriteHeader")},
Args: []ast.Expr{ast.NewIdent("code")},
}},
}}},
}},
},
&ast.AssignStmt{
Lhs: []ast.Expr{ast.NewIdent("_"), ast.NewIdent("_")},
Tok: token.ASSIGN,
Expand Down

0 comments on commit aa9028f

Please sign in to comment.