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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

static: only strip if the file path is not a single slash #171

Merged
merged 2 commits into from Aug 8, 2023

Conversation

wuhan005
Copy link
Member

@wuhan005 wuhan005 commented Aug 8, 2023

Describe the pull request

I apologize for my carelessness. This PR is related to fixing the previous one. #170

When the Index file is placed in the root path of the go embed file system, the single slash / will be trimmed to an empty string. The go embed file system also can not accept it. 馃槀

I have fixed it in this PR and added the test case.

Link to the issue: n/a

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code.

@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Merging #171 (cdaaffa) into main (b567fe0) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   89.49%   89.52%   +0.02%     
==========================================
  Files          17       17              
  Lines        1152     1155       +3     
==========================================
+ Hits         1031     1034       +3     
  Misses         80       80              
  Partials       41       41              

@wuhan005 wuhan005 requested a review from unknwon August 8, 2023 15:26
Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did the test case pass last time? 馃

Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CleanShot 2023-08-08 at 11 39 56@2x

Actually, what's difference between test case 2 and 3? Shouldn't test case 1 have caught the problem?

@wuhan005
Copy link
Member Author

wuhan005 commented Aug 8, 2023

How did the test case pass last time? 馃

The previous test case does not cover this case, so it passed.

Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM, i confused myself with the test setup.

@unknwon unknwon merged commit a89cfda into main Aug 8, 2023
12 checks passed
@unknwon unknwon deleted the wh/static/fix-trim-slash branch August 8, 2023 15:43
@unknwon
Copy link
Member

unknwon commented Aug 8, 2023

https://github.com/flamego/flamego/releases/tag/v1.9.4 has been created for this merge.

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