(f func(profile string))
| 129 | } |
| 130 | |
| 131 | func (m *mkcert) forEachNSSProfile(f func(profile string)) (found int) { |
| 132 | var profiles []string |
| 133 | profiles = append(profiles, nssDBs...) |
| 134 | for _, ff := range FirefoxProfiles { |
| 135 | pp, _ := filepath.Glob(ff) |
| 136 | profiles = append(profiles, pp...) |
| 137 | } |
| 138 | for _, profile := range profiles { |
| 139 | if stat, err := os.Stat(profile); err != nil || !stat.IsDir() { |
| 140 | continue |
| 141 | } |
| 142 | if pathExists(filepath.Join(profile, "cert9.db")) { |
| 143 | f("sql:" + profile) |
| 144 | found++ |
| 145 | } else if pathExists(filepath.Join(profile, "cert8.db")) { |
| 146 | f("dbm:" + profile) |
| 147 | found++ |
| 148 | } |
| 149 | } |
| 150 | return |
| 151 | } |
no test coverage detected