mattn / anko

Scriptable interpreter written in golang
http://play-anko.appspot.com/
MIT License
1.47k stars 118 forks source link

Added string to byte & rune conversion #313

Closed MichaelS11 closed 5 years ago

codecov-io commented 5 years ago

Codecov Report

Merging #313 into master will increase coverage by 0.04%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #313      +/-   ##
==========================================
+ Coverage   91.88%   91.93%   +0.04%     
==========================================
  Files           9        9              
  Lines        2281     2294      +13     
==========================================
+ Hits         2096     2109      +13     
  Misses        122      122              
  Partials       63       63
Impacted Files Coverage Δ
vm/vm.go 86.93% <100%> (+0.1%) :arrow_up:
vm/vmConvertToX.go 94.54% <100%> (+0.6%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ebe5b9b...c2f6f0c. Read the comment docs.

MichaelS11 commented 5 years ago

@mattn Good to go

mattn commented 5 years ago

Thanks. If the string have two or more letters, this works without errors. hmm...I can't decide which is best yet.

MichaelS11 commented 5 years ago

Fix makeValue for struct ptr. Added strings.Builder.

@mattn Please merge

mattn commented 5 years ago

If the string have two or more letters, this works without errors. hmm...I can't decide which is best yet.

What do you think? If a string "foo" is passed for argument typed rune, should it work without error?

https://github.com/mattn/anko/pull/313/commits/ea4ba682721774d4ef573487e7be8a9ef096a505#diff-763921223b22a5e0fa21c13a3532ffe9R542

MichaelS11 commented 5 years ago

I am not sure which is best either. I am fine either way. It is a difficult choice.

mattn commented 5 years ago

Could you please add code to make it error? If someone do not want it, let's remove the check.

mattn commented 5 years ago

Thanks. I'll merge this after test passed.

MichaelS11 commented 5 years ago

Welcome :)

mattn commented 5 years ago

Thank you