Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embed enhancement #2885

Closed
wants to merge 2 commits into from
Closed

Conversation

souloss
Copy link

@souloss souloss commented Sep 28, 2021

  • embed enhancement
  • Add IRouter interface, test and documentation

@codecov
Copy link

codecov bot commented Sep 28, 2021

Codecov Report

Merging #2885 (c32167d) into master (ef16867) will decrease coverage by 0.79%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2885      +/-   ##
==========================================
- Coverage   98.75%   97.95%   -0.80%     
==========================================
  Files          41       24      -17     
  Lines        3062      735    -2327     
==========================================
- Hits         3024      720    -2304     
+ Misses         26       10      -16     
+ Partials       12        5       -7     
Flag Coverage Δ
go-1.13 ?
go-1.14 97.95% <ø> (-0.64%) ⬇️
go-1.15 ?
go-1.16 ?
go-1.17 ?
macos-latest ?
nomsgpack ?
ubuntu-latest 97.95% <ø> (-0.80%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
logger.go
errors.go
tree.go
recovery.go
mode.go
response_writer.go
fs.go
binding/binding_nomsgpack.go
context.go
debug.go
... and 5 more

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 f469c1b...c32167d. Read the comment docs.

@thinkgos
Copy link
Contributor

thinkgos commented Oct 8, 2021

@witchc hello , http.FS may be meet your needs. another feat: #2749
more refer see embedfs

// in testdata file

//go:embed static/css static/img static/views static/1.png static/index.html x.png
var Staticfs embed.FS

// in main

	// 嵌入绑定的文件
	cssFs, _ := fs.Sub(testdata.Staticfs, "static/css")
	r.StaticFS("/css", http.FS(cssFs))
	imgFs, _ := fs.Sub(testdata.Staticfs, "static/img")
	r.StaticFS("/img", http.FS(imgFs))

@souloss souloss closed this Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants