Guest User

Untitled

a guest
Apr 16th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. type myByte byte
  2.  
  3. func main() {
  4.  
  5. var a byte
  6. var b myByte
  7.  
  8. a = b // Complies error: cannot use b (type myByte) as type byte in assignment
  9. a = byte(b) // OK
  10. }
  11.  
  12. func main() {
  13.  
  14. var a byte
  15. var b uint8
  16.  
  17. a = b // OK
  18. b = a // OK
  19. }
Add Comment
Please, Sign In to add comment