@@ -71,10 +71,8 @@ func validateOrgParty(value any) error {
7171 party .TaxID != nil && party .TaxID .Country == l10n .TaxCountryCode (l10n .SE ),
7272 validation .Each (
7373 validation .By (func (value any ) error {
74- id , ok := value .(* org.Identity )
75- if ! ok || id == nil {
76- return nil
77- }
74+ // Casting to org.Identity is safe, as the identity type is validated before this function is called
75+ id , _ := value .(* org.Identity )
7876 if ! id .Type .In (IdentityTypeOrgNr , IdentityTypePersonNr , IdentityTypeCoordinationNr ) {
7977 return validation .NewError ("type" , "must be one of: SE-ON, SE-PN, SE-CN" )
8078 }
@@ -90,10 +88,8 @@ func validateOrgParty(value any) error {
9088// validateSupplier checks the supplier's tax ID requirements.
9189// The supplier's VAT number is always required.
9290func validateSupplier (value any ) error {
93- party , ok := value .(* org.Party )
94- if ! ok || party == nil {
95- return nil
96- }
91+ // Casting to org.Party is safe, as the party is validated before this function is called
92+ party , _ := value .(* org.Party )
9793
9894 return validation .ValidateStruct (party ,
9995 // Swedish Tax ID (VAT ID) is always required for the supplier,
@@ -114,10 +110,8 @@ func validateSupplier(value any) error {
114110}
115111
116112func validateSupplierSimplifiedInvoice (value any ) error {
117- party , ok := value .(* org.Party )
118- if ! ok || party == nil {
119- return nil
120- }
113+ // Casting to org.Party is safe, as the party is validated before this function is called
114+ party , _ := value .(* org.Party )
121115
122116 return validation .ValidateStruct (party ,
123117 validation .Field (& party .Name ,
0 commit comments