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

minor: string to bytes.Buffer #7

Closed
wants to merge 1 commit into from

Conversation

Konstantin8105
Copy link
Contributor

  • minor optimization "string to bytes.Buffer"
  • ignore symbols outside english letters.

@@ -33,24 +33,25 @@ func (h *hacker) Encode(r io.Reader) ([]byte, error) {
}
data := string(d)
data = strings.ToUpper(data)
var encodedValue string
var encode bytes.Buffer
Copy link
Owner

Choose a reason for hiding this comment

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

change this variable name to encodedBufferor encodedValue. encode is a verb

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

}
}

func TestEncodeNotValidLetter(t *testing.T) {
Copy link
Owner

Choose a reason for hiding this comment

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

This is a valid test case. Can you rename this to TestEncodeValidLetter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, test is valid(Ok). But it is valid test for string with not valid letter(hieroglyph). Could you clarify your opinion?

Copy link
Owner

Choose a reason for hiding this comment

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

The letters used in this test is not causing an error, we do not have support of any other language other than english yet, therefore the encode should error out in this scenario but currently it is translating partially without informing the user that part of the data was not translated to morse

@alwindoss
Copy link
Owner

Also, could you open an issue for this improvement

This was referenced Sep 1, 2018
@alwindoss
Copy link
Owner

Closing the PR because of inactivity

@alwindoss alwindoss closed this Jul 17, 2019
@Konstantin8105 Konstantin8105 deleted the b01 branch July 17, 2019 12:55
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