What does "conversion never fails at run time" mean?

Written by
Link to Post

https://www.reddit.com/r/golang/comments/bk26kj/what_does_conversion_never_fails_at_run_time_mean/ by 

I am into Chapter 2 of The Go Programming Language and under a section Type Declarations there is an excerpt that says:

Conversions are allowed between numeric types, and between string and some slice types, as we will see in the next chapter. These conversions may change the representation. For instance, converting a floating-point number to an integer discards any fractional part, and converting a string to a []byte slice allocates a copy of the string data. In any case, a conversion never fails at run time.

May I know why the author says a conversion never fails at run time?

submitted by /u/psychicspies2
[link] [comments]

Article Tags:
· ·
Article Categories:

Comments are closed.