Instead of reflect library. I'd like to recommend this generic 
library https://github.com/samber/lo.

It's very convenient than reflect, and I've been using it for a long time.

If you are not familiar about how to use it, ask GPT4(GPT3.5 does't know it)
On Friday, June 20, 2014 at 4:47:38 PM UTC+8 小菜 wrote:

>
> I  think in Golang, Array, Slice, and Map , all of them are very difficult 
> to use。
>
> For example, I want to check whether an element in the array, get all 
> the map key, or the map value into slice,
>
> With two slice,  intersection or union, the Slice sort, map sort, I found 
> that the operation has no official function support, there is no 
> official  package, so it is very difficult to use, not a 
> standard, efficient way.
>
> Perhaps Golang should like PHP/Python built-in some common operations,  
> Programming 
> language is used to solve practical problems。
>
>
> Reference resources.
>
> Http://us1.php.net/manual/en/ref.array.php 
> <http://us1.php.net/manual/en/ref.array.php>
>
>
>
>    - array_change_key_case 
>    <http://us1.php.net/manual/en/function.array-change-key-case.php> — 
>    Changes the case of all keys in an array
>    - array_chunk <http://us1.php.net/manual/en/function.array-chunk.php> — 
>    Split an array into chunks
>    - array_column <http://us1.php.net/manual/en/function.array-column.php> — 
>    Return the values from a single column in the input array
>    - array_combine 
>    <http://us1.php.net/manual/en/function.array-combine.php> — Creates an 
>    array by using one array for keys and another for its values
>    - array_count_values 
>    <http://us1.php.net/manual/en/function.array-count-values.php> — 
>    Counts all the values of an array
>    - array_diff_assoc 
>    <http://us1.php.net/manual/en/function.array-diff-assoc.php> — 
>    Computes the difference of arrays with additional index check
>    - array_diff_key 
>    <http://us1.php.net/manual/en/function.array-diff-key.php> — Computes 
>    the difference of arrays using keys for comparison
>    - array_diff_uassoc 
>    <http://us1.php.net/manual/en/function.array-diff-uassoc.php> — 
>    Computes the difference of arrays with additional index check which is 
>    performed by a user supplied callback function
>    - array_diff_ukey 
>    <http://us1.php.net/manual/en/function.array-diff-ukey.php> — Computes 
>    the difference of arrays using a callback function on the keys for 
>    comparison
>    - array_diff <http://us1.php.net/manual/en/function.array-diff.php> — 
>    Computes the difference of arrays
>    - array_fill_keys 
>    <http://us1.php.net/manual/en/function.array-fill-keys.php> — Fill an 
>    array with values, specifying keys
>    - array_fill <http://us1.php.net/manual/en/function.array-fill.php> — 
>    Fill an array with values
>    - array_filter <http://us1.php.net/manual/en/function.array-filter.php> — 
>    Filters elements of an array using a callback function
>    - array_flip <http://us1.php.net/manual/en/function.array-flip.php> — 
>    Exchanges all keys with their associated values in an array
>    - array_intersect_assoc 
>    <http://us1.php.net/manual/en/function.array-intersect-assoc.php> — 
>    Computes the intersection of arrays with additional index check
>    - array_intersect_key 
>    <http://us1.php.net/manual/en/function.array-intersect-key.php> — 
>    Computes the intersection of arrays using keys for comparison
>    - array_intersect_uassoc 
>    <http://us1.php.net/manual/en/function.array-intersect-uassoc.php> — 
>    Computes the intersection of arrays with additional index check, compares 
>    indexes by a callback function
>    - array_intersect_ukey 
>    <http://us1.php.net/manual/en/function.array-intersect-ukey.php> — 
>    Computes the intersection of arrays using a callback function on the keys 
>    for comparison
>    - array_intersect 
>    <http://us1.php.net/manual/en/function.array-intersect.php> — Computes 
>    the intersection of arrays
>    - array_key_exists 
>    <http://us1.php.net/manual/en/function.array-key-exists.php> — Checks 
>    if the given key or index exists in the array
>    - array_keys <http://us1.php.net/manual/en/function.array-keys.php> — 
>    Return all the keys or a subset of the keys of an array
>    - array_map <http://us1.php.net/manual/en/function.array-map.php> — 
>    Applies the callback to the elements of the given arrays
>    - array_merge_recursive 
>    <http://us1.php.net/manual/en/function.array-merge-recursive.php> — 
>    Merge two or more arrays recursively
>    - array_merge <http://us1.php.net/manual/en/function.array-merge.php> — 
>    Merge one or more arrays
>    - array_multisort 
>    <http://us1.php.net/manual/en/function.array-multisort.php> — Sort 
>    multiple or multi-dimensional arrays
>    - array_pad <http://us1.php.net/manual/en/function.array-pad.php> — 
>    Pad array to the specified length with a value
>    - array_pop <http://us1.php.net/manual/en/function.array-pop.php> — 
>    Pop the element off the end of array
>    - array_product 
>    <http://us1.php.net/manual/en/function.array-product.php> — Calculate 
>    the product of values in an array
>    - array_push <http://us1.php.net/manual/en/function.array-push.php> — 
>    Push one or more elements onto the end of array
>    - array_rand <http://us1.php.net/manual/en/function.array-rand.php> — 
>    Pick one or more random entries out of an array
>    - array_reduce <http://us1.php.net/manual/en/function.array-reduce.php> — 
>    Iteratively reduce the array to a single value using a callback function
>    - array_replace_recursive 
>    <http://us1.php.net/manual/en/function.array-replace-recursive.php> — 
>    Replaces elements from passed arrays into the first array recursively
>    - array_replace 
>    <http://us1.php.net/manual/en/function.array-replace.php> — Replaces 
>    elements from passed arrays into the first array
>    - array_reverse 
>    <http://us1.php.net/manual/en/function.array-reverse.php> — Return an 
>    array with elements in reverse order
>    - array_search <http://us1.php.net/manual/en/function.array-search.php> — 
>    Searches the array for a given value and returns the corresponding key if 
>    successful
>    - array_shift <http://us1.php.net/manual/en/function.array-shift.php> — 
>    Shift an element off the beginning of array
>    - array_slice <http://us1.php.net/manual/en/function.array-slice.php> — 
>    Extract a slice of the array
>    - array_splice <http://us1.php.net/manual/en/function.array-splice.php> — 
>    Remove a portion of the array and replace it with something else
>    - array_sum <http://us1.php.net/manual/en/function.array-sum.php> — 
>    Calculate the sum of values in an array
>    - array_udiff_assoc 
>    <http://us1.php.net/manual/en/function.array-udiff-assoc.php> — 
>    Computes the difference of arrays with additional index check, compares 
>    data by a callback function
>    - array_udiff_uassoc 
>    <http://us1.php.net/manual/en/function.array-udiff-uassoc.php> — 
>    Computes the difference of arrays with additional index check, compares 
>    data and indexes by a callback function
>    - array_udiff <http://us1.php.net/manual/en/function.array-udiff.php> — 
>    Computes the difference of arrays by using a callback function for data 
>    comparison
>    - array_uintersect_assoc 
>    <http://us1.php.net/manual/en/function.array-uintersect-assoc.php> — 
>    Computes the intersection of arrays with additional index check, compares 
>    data by a callback function
>    - array_uintersect_uassoc 
>    <http://us1.php.net/manual/en/function.array-uintersect-uassoc.php> — 
>    Computes the intersection of arrays with additional index check, compares 
>    data and indexes by a callback functions
>    - array_uintersect 
>    <http://us1.php.net/manual/en/function.array-uintersect.php> — 
>    Computes the intersection of arrays, compares data by a callback function
>    - array_unique <http://us1.php.net/manual/en/function.array-unique.php> — 
>    Removes duplicate values from an array
>    - array_unshift 
>    <http://us1.php.net/manual/en/function.array-unshift.php> — Prepend 
>    one or more elements to the beginning of an array
>    - array_values <http://us1.php.net/manual/en/function.array-values.php> — 
>    Return all the values of an array
>    - array_walk_recursive 
>    <http://us1.php.net/manual/en/function.array-walk-recursive.php> — 
>    Apply a user function recursively to every member of an array
>    - array_walk <http://us1.php.net/manual/en/function.array-walk.php> — 
>    Apply a user function to every member of an array
>    - array <http://us1.php.net/manual/en/function.array.php> — Create an 
>    array
>    - arsort <http://us1.php.net/manual/en/function.arsort.php> — Sort an 
>    array in reverse order and maintain index association
>    - asort <http://us1.php.net/manual/en/function.asort.php> — Sort an 
>    array and maintain index association
>    - compact <http://us1.php.net/manual/en/function.compact.php> — Create 
>    array containing variables and their values
>    - count <http://us1.php.net/manual/en/function.count.php> — Count all 
>    elements in an array, or something in an object
>    - current <http://us1.php.net/manual/en/function.current.php> — Return 
>    the current element in an array
>    - each <http://us1.php.net/manual/en/function.each.php> — Return the 
>    current key and value pair from an array and advance the array cursor
>    - end <http://us1.php.net/manual/en/function.end.php> — Set the 
>    internal pointer of an array to its last element
>    - extract <http://us1.php.net/manual/en/function.extract.php> — Import 
>    variables into the current symbol table from an array
>    - in_array <http://us1.php.net/manual/en/function.in-array.php> — 
>    Checks if a value exists in an array
>    - key_exists <http://us1.php.net/manual/en/function.key-exists.php> — 
>    Alias of array_key_exists
>    - key <http://us1.php.net/manual/en/function.key.php> — Fetch a key 
>    from an array
>    - krsort <http://us1.php.net/manual/en/function.krsort.php> — Sort an 
>    array by key in reverse order
>    - ksort <http://us1.php.net/manual/en/function.ksort.php> — Sort an 
>    array by key
>    - list <http://us1.php.net/manual/en/function.list.php> — Assign 
>    variables as if they were an array
>    - natcasesort <http://us1.php.net/manual/en/function.natcasesort.php> — 
>    Sort an array using a case insensitive "natural order" algorithm
>    - natsort <http://us1.php.net/manual/en/function.natsort.php> — Sort 
>    an array using a "natural order" algorithm
>    - next <http://us1.php.net/manual/en/function.next.php> — Advance the 
>    internal array pointer of an array
>    - pos <http://us1.php.net/manual/en/function.pos.php> — Alias of 
>    current
>    - prev <http://us1.php.net/manual/en/function.prev.php> — Rewind the 
>    internal array pointer
>    - range <http://us1.php.net/manual/en/function.range.php> — Create an 
>    array containing a range of elements
>    - reset <http://us1.php.net/manual/en/function.reset.php> — Set the 
>    internal pointer of an array to its first element
>    - rsort <http://us1.php.net/manual/en/function.rsort.php> — Sort an 
>    array in reverse order
>    - shuffle <http://us1.php.net/manual/en/function.shuffle.php> — 
>    Shuffle an array
>    - sizeof <http://us1.php.net/manual/en/function.sizeof.php> — Alias of 
>    count
>    - sort <http://us1.php.net/manual/en/function.sort.php> — Sort an array
>    - uasort <http://us1.php.net/manual/en/function.uasort.php> — Sort an 
>    array with a user-defined comparison function and maintain index 
> association
>    - uksort <http://us1.php.net/manual/en/function.uksort.php> — Sort an 
>    array by keys using a user-defined comparison function
>    - usort <http://us1.php.net/manual/en/function.usort.php> — Sort an 
>    array by values using a user-defined comparison function
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/50f576d5-d2a3-4a67-a488-59e835a60a36n%40googlegroups.com.

Reply via email to