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

fix: *string(nil) not equal &string #152

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Conversation

jiuker
Copy link
Contributor

@jiuker jiuker commented Jul 4, 2023

fix: *string(nil) not equal &string("")

func TestRequired(t *testing.T) {
	empty := ""
	a := struct {
		A *string
	}{
		A: &empty,
	}
	t.Log(Required("A", "a", a.A))
	t.Log(BeforeRequired("A", "a", a.A))
}
=== RUN   TestRequired
    require_test.go:14: A in a is required
    require_test.go:15: <nil>
--- PASS: TestRequired (0.00s)
PASS

@youyuanwu
Copy link
Member

Can you add the test case in the test file?

@jiuker
Copy link
Contributor Author

jiuker commented Jul 17, 2023

@youyuanwu I put the UT now. Reivew plz.

@jiuker
Copy link
Contributor Author

jiuker commented Jul 17, 2023

@youyuanwu Looks like workflow failed. But it doesn't feel like it has anything to do with the pr I submitted.

@youyuanwu
Copy link
Member

Master branch ci is working now. go version is updated as well. You can rebase.

@jiuker
Copy link
Contributor Author

jiuker commented Aug 9, 2023

@youyuanwu cc

ut
Signed-off-by: guozhi.li <guozhi.li@daocloud.io>
@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #152 (1621beb) into master (c9f1d67) will decrease coverage by 0.07%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master     #152      +/-   ##
==========================================
- Coverage   90.73%   90.66%   -0.07%     
==========================================
  Files          22       22              
  Lines        2979     2990      +11     
==========================================
+ Hits         2703     2711       +8     
- Misses        224      226       +2     
- Partials       52       53       +1     
Files Changed Coverage Δ
values.go 98.32% <80.00%> (-0.98%) ⬇️

@jiuker
Copy link
Contributor Author

jiuker commented Aug 10, 2023

@casualjim will I do more tests for code cover?

@youyuanwu youyuanwu merged commit 348543c into go-openapi:master Aug 10, 2023
7 of 9 checks passed
@wawaka
Copy link

wawaka commented Nov 28, 2023

this should be reverted as it breaks validation completely @youyuanwu

vgogolev1703 pushed a commit to vgogolev1703/validate that referenced this pull request Nov 28, 2023
vgogolev1703 pushed a commit to vgogolev1703/validate that referenced this pull request Nov 28, 2023
This reverts commit 348543c.

Signed-off-by: Vlad Gogolev <v.gogolev@uzum.com>
casualjim added a commit that referenced this pull request Dec 1, 2023
Revert "fix: *string(nil) not equal &string #152"
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

4 participants