Converted to go.
Added some documentation and handled a special case where only one list item was given.