-
Notifications
You must be signed in to change notification settings - Fork 308
migrate to record #1665
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
base: master
Are you sure you want to change the base?
migrate to record #1665
Changes from 13 commits
0dfabb7
638f614
04d7445
ff80688
0bd43e4
f695e4b
c1a7c99
a20419b
62b20a6
d4c548a
daa7870
0304920
cfae034
9e986c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// IntOrString.cs(7,36): error CS0518: Predefined type 'System.Runtime.CompilerServices.IsExternalInit' is not defined or imported | ||
namespace System.Runtime.CompilerServices | ||
{ | ||
internal static class IsExternalInit { } | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace k8s.Models | ||
{ | ||
[JsonConverter(typeof(IntOrStringJsonConverter))] | ||
public struct IntOrString | ||
{ | ||
public string? Value { get; private init; } | ||
Check warning on line 6 in src/KubernetesClient/Models/IntOrString.cs
|
||
|
||
public static implicit operator IntOrString(int v) | ||
{ | ||
return Convert.ToString(v); | ||
} | ||
|
||
public static implicit operator IntOrString(long v) | ||
{ | ||
return Convert.ToString(v); | ||
} | ||
|
||
public static implicit operator string(IntOrString v) | ||
{ | ||
return v.Value; | ||
} | ||
|
||
public static implicit operator IntOrString(string v) | ||
{ | ||
return new IntOrString { Value = v }; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return Value; | ||
} | ||
|
||
public int ToInt() | ||
{ | ||
return int.Parse(Value); | ||
} | ||
} | ||
} |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ToString() can return null when Value is null, which may cause issues for consumers expecting a non-null string. Consider returning string.Empty or a default value when Value is null.
Copilot uses AI. Check for mistakes.