mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
[golang] Fix Null pointer exception in toVarName (#377)
This commit is contained in:
parent
001f5ae50d
commit
83e14a7b44
@ -144,8 +144,9 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
|
||||
@Override
|
||||
public String toVarName(String name) {
|
||||
|
||||
// replace - with _ e.g. created-at => created_at
|
||||
name = sanitizeName(name.replaceAll("-", "_"));
|
||||
name = sanitizeName(name);
|
||||
|
||||
// if it's all uppper case, do nothing
|
||||
if (name.matches("^[A-Z_]*$"))
|
||||
|
Loading…
Reference in New Issue
Block a user