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

Improve golint coverage #90

Merged
merged 3 commits into from
Feb 21, 2021

Conversation

wafuwafu13
Copy link
Contributor

@wafuwafu13 wafuwafu13 commented Feb 21, 2021

@sunfish-shogi

Related #23 Golint

I fixed golint warning except should have comment or be unexported.
https://goreportcard.com/report/github.com/abema/go-mp4#golint

@wafuwafu13
Copy link
Contributor Author

if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) warning also occured here, but I couldn't fix because of no new variables on left side of :=.

go-mp4/marshaller.go

Lines 264 to 269 in d23f5a8

if dst, err := boxType.New(ctx); err != nil {
return nil, 0, err
} else {
n, err := Unmarshal(r, payloadSize, dst, ctx)
return dst, n, err
}

	dst, err := boxType.New(ctx)
	if err != nil {
		return nil, 0, err
	}
	n, err := Unmarshal(r, payloadSize, dst, ctx) // no new variables on left side of :=
	return dst, n, err

@sunfish-shogi
Copy link
Contributor

Thank you for your pull request!

#90 (comment)
In this case, you can use "=" operator instead of ":=".
Should I wait for your additional changes?

@wafuwafu13
Copy link
Contributor Author

Thank you for teaching me :)
I fixed it at f9ab551 .

@sunfish-shogi sunfish-shogi merged commit 7a6fcbc into abema:master Feb 21, 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.

2 participants