diff options
| author | Shulhan <ms@kilabit.info> | 2024-01-14 19:13:19 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-01-14 19:13:19 +0700 |
| commit | 1b3f5599ee2e5ef7360ca6eea6d30550fdb29512 (patch) | |
| tree | 623531d4ebbece78a02450a03f37c8032ed63b06 /lib/ini | |
| parent | 84ee82ffe4bedf85aa3a69f45034d0d1e1b74e6a (diff) | |
| download | pakakeh.go-1b3f5599ee2e5ef7360ca6eea6d30550fdb29512.tar.xz | |
lib/ini: use method IsExported in marshalStruct
Since Go 1.17, the [reflect.StructField] add method IsExported which
give clear indication that the field is exported rather than checking
not-empty PkgPath.
Diffstat (limited to 'lib/ini')
| -rw-r--r-- | lib/ini/ini.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/ini/ini.go b/lib/ini/ini.go index 47ffb448..ee9bfdc1 100644 --- a/lib/ini/ini.go +++ b/lib/ini/ini.go @@ -161,9 +161,7 @@ func (in *Ini) marshalStruct( ftype = field.Type kind = ftype.Kind() - // TODO: replace with IsExported() once go.mod version set to - // 1.17. - if field.PkgPath != "" { + if !field.IsExported() { continue } |
