GoAdminGroup / go-admin

Deprecated io/ioutil package usage GO-C4001
Anti-pattern
Minor
4 occurrences in this check
ioutil.WriteFile is deprecated, use os.WriteFile instead
481		src := plug.GetInfo().ModulePath + " " + plug.GetInfo().OldVersion
482		dist := plug.GetInfo().ModulePath + " " + plug.GetInfo().Version
483		content = bytes.ReplaceAll(content, []byte(src), []byte(dist))
484		_ = ioutil.WriteFile(h.config.BootstrapFilePath, content, 0644)485	}
486
487	// TODO: 实现运行环境与编译环境隔离
ioutil.WriteFile is deprecated, use os.WriteFile instead
467		if err != nil {
468			logger.Error("read bootstrap file error: ", err)
469		} else {
470			err = ioutil.WriteFile(h.config.BootstrapFilePath, []byte(string(content)+`471import _ "`+plug.GetInfo().ModulePath+`"`), 0644)
472			if err != nil {
473				logger.Error("write bootstrap file error: ", err)
ioutil.ReadFile is deprecated, use os.ReadFile instead
477
478	if h.config.GoModFilePath != "" && utils.FileExist(h.config.GoModFilePath) &&
479		plug.GetInfo().CanUpdate && plug.GetInfo().OldVersion != "" {
480		content, _ := ioutil.ReadFile(h.config.BootstrapFilePath)481		src := plug.GetInfo().ModulePath + " " + plug.GetInfo().OldVersion
482		dist := plug.GetInfo().ModulePath + " " + plug.GetInfo().Version
483		content = bytes.ReplaceAll(content, []byte(src), []byte(dist))
ioutil.ReadFile is deprecated, use os.ReadFile instead
463	}
464
465	if h.config.BootstrapFilePath != "" && utils.FileExist(h.config.BootstrapFilePath) {
466		content, err := ioutil.ReadFile(h.config.BootstrapFilePath)467		if err != nil {
468			logger.Error("read bootstrap file error: ", err)
469		} else {