Remove unnecessary code (#24610)

As title, remove unnecessary code.
This commit is contained in:
Lunny Xiao 2023-05-10 12:57:06 +08:00 committed by GitHub
parent 29637b03b2
commit c355728a6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 20 deletions

View file

@ -30,7 +30,6 @@ type ConfigProvider interface {
Section(section string) ConfigSection
NewSection(name string) (ConfigSection, error)
GetSection(name string) (ConfigSection, error)
DeleteSection(name string) error
Save() error
}
@ -40,12 +39,6 @@ type iniFileConfigProvider struct {
newFile bool // whether the file has not existed previously
}
// NewEmptyConfigProvider create a new empty config provider
func NewEmptyConfigProvider() ConfigProvider {
cp, _ := NewConfigProviderFromData("")
return cp
}
// NewConfigProviderFromData this function is only for testing
func NewConfigProviderFromData(configContent string) (ConfigProvider, error) {
var cfg *ini.File
@ -121,11 +114,6 @@ func (p *iniFileConfigProvider) GetSection(name string) (ConfigSection, error) {
return p.File.GetSection(name)
}
func (p *iniFileConfigProvider) DeleteSection(name string) error {
p.File.DeleteSection(name)
return nil
}
// Save save the content into file
func (p *iniFileConfigProvider) Save() error {
if p.opts.CustomConf == "" {