Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code bug #3164

Open
yimuysl001 opened this issue Nov 20, 2023 · 2 comments
Open

Code bug #3164

yimuysl001 opened this issue Nov 20, 2023 · 2 comments
Assignees
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. need more details

Comments

@yimuysl001
Copy link

yimuysl001 commented Nov 20, 2023

1. What version of Go and system type/arch are you using?

go 1.20

2. What version of GoFrame are you using?

v 2.5.6

3. Can this issue be re-produced with the latest release?

4. What did you do?

yes

5. What did you expect to see?

  1. gdb 包下面 清除表缓存与清除所有缓存实际方法一致
// ClearCache removes cached sql result of certain table.
func (c *Core) ClearCache(ctx context.Context, table string) (err error) {
	return c.db.GetCache().Clear(ctx)
}

// ClearCacheAll removes all cached sql result from cache
func (c *Core) ClearCacheAll(ctx context.Context) (err error) {
	return c.db.GetCache().Clear(ctx)
}
  1. gutil 包下面 GetOrDefaultAny 函数判断条件为空字符串,与预期不符
// GetOrDefaultAny checks and returns value according whether parameter `param` available.
// It returns `param[0]` if it is available, or else it returns `def`.
func GetOrDefaultAny(def interface{}, param ...interface{}) interface{} {
	value := def
	if len(param) > 0 && param[0] != "" {
		value = param[0]
	}
	return value
}

3.数据库驱动dm ,config 文件配置相应的模块后,还是使用的默认模块,没有正常切为配置的模块

6. What did you see instead?

@Issues-translate-bot Issues-translate-bot changed the title 代码bug Code bug Nov 20, 2023
@gqcn gqcn self-assigned this Oct 7, 2024
@gqcn gqcn added bug It is confirmed a bug, but don't worry, we'll handle it. need more details labels Oct 7, 2024
@gqcn
Copy link
Member

gqcn commented Oct 7, 2024

@yimuysl001 不好意思,我来晚了,由于邮件丢失我错过了一些issue的消息提示。
感谢反馈!这里的第1点已经再后续版本中修复了,同时2的话我已经提了PR修复 #3844 。第3点的话不是很明确,能否再进一步描述,或者提供可复现该问题的最小可运行源码?

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@yimuysl001 Sorry, I'm late. I missed some issue messages due to lost emails.
Thanks for the feedback! The 1 point here has been fixed in subsequent versions. At the same time, I have submitted a PR to fix the 2 point #3844. Point 3 is not very clear. Can you describe it further or provide the minimum runnable source code that can reproduce the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. need more details
Projects
None yet
Development

No branches or pull requests

3 participants