Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

tangx/cobrautils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cobrax 使用反射获取 flag 配置

this project is archived

see https://github.com/go-jarvis/cobrautils

Usage

Demo: example

Attention: 数值的类型的必须是 int64。 因为不想做兼容。

QA

kind and type

相较于 Type 而言,Kind 所表示的范畴更大。类似于家用电器(Kind)和电视机(Type)之间的对应关系。或者电视机(Kind)和 42 寸彩色电视机(Type)

Type 是类型。Kind 是类别。Type 和 Kind 可能相同,也可能不同。通常基础数据类型的 Type 和 Kind 相同,自定义数据类型则不同。

对于反射中的 kind 我们既可以通过 reflect.Type 来获取,也可以通过 reflect.Value 来获取。他们得到的值和类型均是相同的。

About

cobrax

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages