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

Loss of models Scope When Using map[string]*models.XX convert to go/models.ts #3709

Closed
Yuelioi opened this issue Aug 26, 2024 · 0 comments · Fixed by #3978
Closed

Loss of models Scope When Using map[string]*models.XX convert to go/models.ts #3709

Yuelioi opened this issue Aug 26, 2024 · 0 comments · Fixed by #3978
Labels
Bug Something isn't working

Comments

@Yuelioi
Copy link

Yuelioi commented Aug 26, 2024

Description

map type cant with pointer value

To Reproduce

with pointer

type Config struct {
	baseDir       string
	SystemConfig  *models.SystemConfig            `json:"system"`  
	PluginConfigs map[string]*models.PluginConfig `json:"plugins"` // here
	Test          *models.SystemConfig            `json:"test"`
}

convert to

export namespace config {
	
	export class Config {
	    system?: models.SystemConfig;  // works well
	    plugins: {[key: string]: PluginConfig}; // <==here,  error loss models.
	    test?: models.SystemConfig; // works well

Expected behaviour

export namespace config {
	
	export class Config {
	    system?: models.SystemConfig;  // works well
	    plugins: {[key: string]: mdels.PluginConfig}; // 
	    test?: models.SystemConfig; // works well

Screenshots

No response

Attempted Fixes

No response

System Details

┌───────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                             |
| Version      | 2009 (Build: 19045)                                        |
| ID           | 22H2                                                       |
| Go Version   | go1.22.1                                                   |
| Platform     | windows                                                    |
| Architecture | amd64                                                      |
| CPU          | Intel(R) Core(TM) i7-8700K                  |
| GPU          | NVIDIA GeForce GTX 1660 Ti (NVIDIA) - Driver: 31.0.15.3623 |
| Memory       | 16GB                                                       |
└───────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version        |
| WebView2   | N/A          | Installed | 127.0.2651.105 |
| Nodejs     | N/A          | Installed | 20.11.0        |
| npm        | N/A          | Installed | 10.3.0         |
| *upx       | N/A          | Installed | upx 4.2.4      |
| *nsis      | N/A          | Available |                |
└─────────────── * - Optional Dependency ────────────────┘

Additional context

No response

@Yuelioi Yuelioi added the Bug Something isn't working label Aug 26, 2024
@coderabbitai coderabbitai bot mentioned this issue Feb 10, 2025
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant