otiai10 / marmoset

The very minimum web toolkit, less than framework
https://github.com/otiai10/marmoset-example
MIT License
11 stars 4 forks source link

LoadViews not working on Windows #7

Closed otiai10 closed 3 years ago

otiai10 commented 5 years ago

Fixes #6 CC @wangsongyan

codecov-io commented 5 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@2adcf18). Click here to learn what that means. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##             master    #7   +/-   ##
======================================
  Coverage          ?   69%           
======================================
  Files             ?     6           
  Lines             ?   171           
  Branches          ?     0           
======================================
  Hits              ?   118           
  Misses            ?    43           
  Partials          ?    10
Impacted Files Coverage Δ
render.go 81.81% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2adcf18...293e522. Read the comment docs.

otiai10 commented 5 years ago

@wangsongyan

I'd like to ask you a favor. Could you please do the following steps to make it sure that develop branch is NOT working on Windows and bugfix/windows-pathsep branch can fix the problem?

% git clone https://github.com/otiai10/marmoset.git
% cd marmoset
% git checkout develop
% go test
# SHOULD be failed
% git checkout bugfix/windows-pathsep
% go test
# SHOULD be succeeded
wangsongyan commented 5 years ago

both failed. (⊙︿⊙)

  1. develop branch:
    net/http.(*conn).serve.func1(0xc0000ab680)
        C:/Go/src/net/http/server.go:1746 +0xd7
    panic(0x7ade60, 0xb04000)
        C:/Go/src/runtime/panic.go:513 +0x1c7
    html/template.(*Template).escape(0x0, 0x0, 0x0)
        C:/Go/src/html/template/template.go:95 +0x35
    html/template.(*Template).Execute(0x0, 0x8825a0, 0xc00021a380, 0x7adb00, 0xc0002528d0, 0x40d6e4, 0x7faf60)
        C:/Go/src/html/template/template.go:119 +0x36
    github.com/otiai10/marmoset.Renderer.HTML(0x7a0101, 0x885540, 0xc00021a380, 0x818a2d, 0x5, 0x7adb00, 0xc0002528d0, 0x8, 0xc00029fcd8)
        E:/Workspace/GoProject/src/github.com/otiai10/marmoset/render.go:53 +0x10d
    github.com/otiai10/marmoset.TestLoadViews.func2(0x885540, 0xc00021a380, 0xc0000fed00)
        E:/Workspace/GoProject/src/github.com/otiai10/marmoset/all_test.go:202 +0x180
    github.com/otiai10/marmoset.(*Router).handleFilteredFunc(0xc0001492c0, 0x8368f8, 0x885540, 0xc00021a380, 0xc0000fed00)
        E:/Workspace/GoProject/src/github.com/otiai10/marmoset/router.go:225 +0x61
    github.com/otiai10/marmoset.(*Router).ServeHTTP(0xc0001492c0, 0x885540, 0xc00021a380, 0xc0000fed00)
  2. bugfix/windows-pathsep branch:
    net/http.(*conn).serve.func1(0xc00015c3c0)
        C:/Go/src/net/http/server.go:1746 +0xd7
    panic(0x7ade60, 0xb04000)
        C:/Go/src/runtime/panic.go:513 +0x1c7
    html/template.(*Template).escape(0x0, 0x0, 0x0)
        C:/Go/src/html/template/template.go:95 +0x35
    html/template.(*Template).Execute(0x0, 0x8825a0, 0xc0001ea1c0, 0x7adb00, 0xc0002728d0, 0x40d6e4, 0x7faf60)
        C:/Go/src/html/template/template.go:119 +0x36
    github.com/otiai10/marmoset.Renderer.HTML(0x7a0101, 0x885540, 0xc0001ea1c0, 0x818a2d, 0x5, 0x7adb00, 0xc0002728d0, 0x8, 0xc000247cd8)
        E:/Workspace/GoProject/src/github.com/otiai10/marmoset/render.go:53 +0x10d
    github.com/otiai10/marmoset.TestLoadViews.func2(0x885540, 0xc0001ea1c0, 0xc000167000)
        E:/Workspace/GoProject/src/github.com/otiai10/marmoset/all_test.go:202 +0x180
    github.com/otiai10/marmoset.(*Router).handleFilteredFunc(0xc000160f00, 0x8368f8, 0x885540, 0xc0001ea1c0, 0xc000167000)

    Here's some information that might be useful to you:

    f: E:/Workspace/GoProject/src/github.com/otiai10/marmoset/all_test.go
    viewpath: E:/Workspace/GoProject/src/github.com/otiai10/marmoset/testdata/views\
    fullpath: E:\Workspace\GoProject\src\github.com\otiai10\marmoset\testdata\views\index.html
    name: E:\Workspace\GoProject\src\github.com\otiai10\marmoset\testdata\views\index
otiai10 commented 5 years ago

@wangsongyan Thanks 😢

Could you let me know the output of go env again?

wangsongyan commented 5 years ago
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\xxx\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=E:\Workspace\GoProject
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\xxx\AppData\Local\Temp\go-build566861162=/tmp/go-build -gno-record-gcc-switches
codecov-commenter commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@2adcf18). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main       #7   +/-   ##
=======================================
  Coverage        ?   56.02%           
=======================================
  Files           ?        6           
  Lines           ?      141           
  Branches        ?        0           
=======================================
  Hits            ?       79           
  Misses          ?       56           
  Partials        ?        6           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2adcf18...82a60e4. Read the comment docs.