第4回の課題(大倉) - #18
Open
ookura-mf wants to merge 4 commits into
Open
第4回の課題(大倉)#18ookura-mf wants to merge 4 commits into
ookura-mf wants to merge 4 commits into
Conversation
ookura-mf
marked this pull request as ready for review
April 1, 2020 15:54
ookura-mf
commented
Apr 1, 2020
| } | ||
|
|
||
| for k, v := range studnetIDMap { | ||
| studentIDSlice := make([]int, len(studentIDMap)) |
Author
There was a problem hiding this comment.
mapからslice作れんかなぁと思ったのですが、無理っぽかったので愚直に詰めました
Owner
There was a problem hiding this comment.
自分の知る限りそういうメソッドはないので、自前で変換する必要があります:pray:
mf-sakura
reviewed
Apr 6, 2020
mf-sakura
left a comment
Owner
There was a problem hiding this comment.
@ookura-mf
第四回の課題にコメントしました:pray:
Comment on lines
+9
to
+10
| number := i | ||
| numbers = append(numbers, &number) |
| return n + 1 | ||
| } | ||
| func incrementWithPointer(n *int) { | ||
| fmt.Printf("n's pointer is %v in incrementWithPointer\n", n) |
Comment on lines
+29
to
+36
| index := 0 | ||
| for key := range studentIDMap { | ||
| studentIDSlice[index] = key | ||
| index++ | ||
| } | ||
| sort.Slice(studentIDSlice, func(i, j int) bool { return studentIDSlice[i] < studentIDSlice[j] }) | ||
|
|
||
| for _, key := range studentIDSlice { |
| } | ||
|
|
||
| for k, v := range studnetIDMap { | ||
| studentIDSlice := make([]int, len(studentIDMap)) |
Owner
There was a problem hiding this comment.
自分の知る限りそういうメソッドはないので、自前で変換する必要があります:pray:
Comment on lines
+29
to
+31
| if err := file.Close(); err != nil { | ||
| fmt.Println("Error has occurred by file.Close().") | ||
| } |
Owner
There was a problem hiding this comment.
ここのエラーを呼び出し元に返す場合は、第5回の解説で説明した通り以下の様な実装にするのが良いです。
if closeErr := file.Close(); closeErr != nil {
err = closeErr
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.