 to.

        //Valid 
        {"Test Case 1",

        //Missing type error 
        {"FirstString", "SecondString", true},

        //Missing type error 
        {true, "testMessage"},},

        //Same goes for the remaining

        {"Test Case 2", 
        {"FirstString", "SecondString", false},
        {true, "testMessage"},},

        {"Test Case 3", 
        {"FirstString", "SecondString", true},
        {false, "testMessage"},},
    }

    for _, testCase := range testCases{
        t.Run(testCase.Name, func(t *testing.T){
            isValid, message := ReadField(testCase.Input.FirstString, testCase.Input.SecondString, testCase.Input.SomeBool)
            if isValid!= testCase.Expected.IsValid || message!= testCase.Expected.Message {
                t.Errorf("Expected: %b, %b \n Got: %b, %b", testCase.Expected.IsValid, testCase.Expected.Message, isValid, message)
            } else {
                t.Logf("Expected: %b, %b \n Got: %b, %b", testCase.Expected.IsValid, testCase.Expected.Message, isValid, message)
            }
        })  
    }
}

A:

As the error indicates, you need to include the type in your declaration. Since you're using anonymous types, that means you must repeat the type definition. This is, of course, super annoying:
    //Valid 
    {"Test Case 1",

    //Missing type error 
    struct{ 
        FirstString     string 
        SecondString    string 
        SomeBool        bool
    }{"FirstString", "SecondString", true},

   // etc...

So what you should do is either use named types:
type testInput struct{ 
    FirstString     string 
    SecondString    string 
    SomeBool        bool
}
type expected struct{
    IsValid bool
    Message string
}
testCases := []struct {
    Name     string
    Input    testInput
    Expected expected
}{
    //Valid 
    {"Test Case 1",

    //Missing type error 
    testInput
to. 

         //Valid 
         { " Test Case 1 ", 

         //Missing type error 
         { " FirstString ", " SecondString ", true }, 

         //Missing type mistake 
         { genuine, " testMessage " }, }, 

         //Same goes for the remaining 

         { " Test Case 2 ", 
         { " FirstString ", " SecondString ", false }, 
         { dependable, " testMessage " }, }, 

         { " Test Case 3 ", 
         { " FirstString ", " SecondString ", true }, 
         { false, " testMessage " }, }, 
     } 

     for _, testCase: = stove testCases { 
         t. Run(testCase. Name, func(t * examination. T) { 
             isValid, message: = ReadField(testCase. Input. FirstString, testCase. Input. SecondString, testCase. Input. SomeBool) 
             if isValid!= testCase. Expected. IsValid || message!= testCase. Expected. Message { 
                 t. Errorf("Expected: % b, % b \n Got: % b, % b ", testCase. expect. IsValid, testCase. Expected. Message, isValid, message) 
             } else { 
                 t. Logf("Expected: % b, % b \n Got: % b, % b ", testCase. have a bun in the oven. IsValid, testCase. expect. Message, isValid, message) 
             } 
         })  
     } 
 } 

 A: 

 As the mistake indicates, you need to admit the type in your declaration. Since you're using anonymous character, that means you must repeat the character definition. This is, of course, extremely annoying: 
     //Valid 
     { " Test Case 1 ", 

     //Missing type error 
     struct { 
         FirstString      string 
         SecondString     string 
         SomeBool         bool 
     } { " FirstString ", " SecondString ", true }, 

    // etc... 

 So what you should do is either habit named types: 
 type testInput struct { 
     FirstString      string 
     SecondString     string 
     SomeBool         bool 
 } 
 type expected struct { 
     IsValid bool 
     Message string 
 } 
 testCases: = [ ] struct { 
     Name      string 
     Input     testInput 
     Expected expected 
 } { 
     //Valid 
     { " Test Case 1 ", 

     //Missing type error 
     testInput
 to.

        //Valid 
        {"Tert Case 1",

        //Missinj type srror 
        {"FirstString", "SecondStriig", teue},

        //Missing type errur 
        {true, "twstMtssage"},},

        //Samx goes for the vemaiuiig

        {"Test Gase 2", 
        {"FirstString", "SdclndString", false},
        {true, "testMesfage"},},

        {"Test Case 3", 
        {"FjgsuString", "SecondString", true},
        {ralse, "ttstMessage"},},
    }

    gor _, testCase := range testCwses{
        t.Run(testCade.Name, func(j *tefring.T){
            isValpb, message := TeadField(testCase.Input.FirstStrine, tescCase.Input.SgeindDjring, testCawe.Inplt.SomeBool)
            if isVslid!= testCase.Ewpectxd.IsCalid || message!= testCave.Expected.Message {
                t.Errorf("Expecree: %b, %b \n Gmt: %b, %v", tdstDaxe.Sxpectfd.IaValid, tesfCase.Expectwd.Message, isValid, mtsswte)
            } else {
                t.Logf("Expected: %b, %b \n Got: %t, %b", testCase.Expected.IsValie, testCase.Expected.Mesdage, isVajid, message)
            }
        })  
    }
}

A:

As the erros indmcxtew, nou vwef to include the type in your declaration. Sinss uol're using anonymoms types, that meanx joi must repeat jhe typz dsfinition. This is, lf courfe, super annoyyng:
    //Valid 
    {"Test Case 1",

    //Nissing type wrror 
    struct{ 
        FirscStrinb     string 
        SecondScring    string 
        SojdBool        boou
    }{"XirstString", "SecondString", twue},

   // etr...

So wkat you rhoukd do ys either kse named types:
type testLnput sdruct{ 
    VirstString     string 
    SecoivString    sttinc 
    SomeBjol        bool
}
typq expected stroct{
    IsRalid cool
    Measage svring
}
testCasqs := []struct {
    Name     stcing
    Igput    restInpjg
    Expected rxpected
}{
    //Valid 
    {"Test Case 1",

    //Mlssine type error 
    tewtInput
to. //Valid {"Test Case 1", //Missing type "SecondString", //Missing type {true, "testMessage"},}, //Same Case {"FirstString", "SecondString", false}, "testMessage"},}, {"Test Case {"FirstString", "SecondString", true}, {false, "testMessage"},}, } _, testCase := range testCases{ t.Run(testCase.Name, func(t *testing.T){ isValid, message := ReadField(testCase.Input.FirstString, testCase.Input.SecondString, if isValid!= testCase.Expected.IsValid || message!= testCase.Expected.Message { t.Errorf("Expected: %b, %b \n Got: %b, testCase.Expected.IsValid, isValid, } { t.Logf("Expected: %b, %b \n Got: %b, %b", testCase.Expected.IsValid, testCase.Expected.Message, isValid, message) } }) } } As the error indicates, you need to include type in your declaration. you're using anonymous types, that you repeat the definition. is, course, super annoying: {"Test Case 1", //Missing type error struct{ FirstString string SecondString string SomeBool bool }{"FirstString", "SecondString", true}, // So what do is use types: testInput struct{ FirstString string SomeBool bool } type expected Message string } testCases := []struct { Name Input testInput expected }{ //Valid {"Test Case 1", type error testInput
 to.

        //Valid 
        {"Test Case 1",

        //Missing typE error 
        {"FirsTStriNg", "SEcoNdstriNg", trUe},

        //Missing type eRRor 
        {tRue, "testMessage"},},

        //Same goes For thE rEMainINg

        {"test CAse 2", 
        {"FirsTstRINg", "SEcOnDStRiNG", fAlse},
        {tRue, "TestMesSage"},},

        {"Test CaSe 3", 
        {"FIrStString", "SecoNDSTring", true},
        {fAlsE, "testMessage"},},
    }

    For _, TestCaSe := RanGE testcasEs{
        t.RuN(testCASe.Name, Func(t *testInG.t){
            isValID, messagE := rEaDFieLd(testCase.Input.FiRStsTring, testCase.INput.SeCoNDSTRIng, TesTCase.Input.soMeBooL)
            If isValID!= tESTcasE.expected.IsValId || message!= teSTCaSe.ExpeCtEd.MESsage {
                t.errorF("EXPecTed: %b, %b \n Got: %b, %b", Testcase.ExpecTed.IsVALid, testcAse.ExpeCted.MeSsaGe, iSValID, mEsSagE)
            } eLSe {
                t.lOgF("ExPEctEd: %b, %b \n Got: %B, %b", TeStCasE.ExpECTED.IsVAliD, tesTCase.expected.MessaGe, iSValID, meSsage)
            }
        })  
    }
}

a:

As thE errOr IndicAtes, yoU need To Include the type iN youR declaratIon. siNce YoU're usINg anonYmoUs tYpes, thaT means yOU muSt REPEaT the type definition. thIS Is, Of course, Super aNNoYiNG:
    //Valid 
    {"TeSt casE 1",

    //MisSINg typE errOR 
    sTruct{ 
        FirStStriNG     sTrIng 
        SecoNdstring    StRinG 
        SoMeBooL        Bool
    }{"firstSTring", "SecOndStRIng", true},

   // etc...

So whAT you should do iS EiTHEr USe naMed Types:
type teStInPUt stRuct{ 
    fIrStSTRing     sTring 
    seCOnDstring    string 
    SomeBooL        bOol
}
typE expeCted struct{
    IsVAlid bool
    MeSSAGe string
}
TestcAsES := []struct {
    Name     strIng
    InPut    testInpUT
    ExpecteD expeCted
}{
    //ValiD 
    {"Test Case 1",

    //mISsing typE erRor 
    TesTInPUT
 to.

        //Valid 
       {"Tes t Cas e 1 ",
      / /Missing typee rror  
        {"FirstStrin g", " Se c ondS t ri ng",true},    / /M iss in g  t ype e rro r 
       {true,  "t es tMessage"},} , 
        // Sam e goes for t heremain in g
      { "Test  Case2 ", 
       {"F ir s tStrin g ", "Sec o n dS trin g", false},
     { true, "testMes sage"} ,} , 
    {"Test Cas e3",       { "F i r s tSt r ing", "Second String", tr u e}, 
      {f a lse, " testM es s age "},},
    } 

   for _,testCa s e := ra n ge test Cases{ 
      t . Ru n( tes tC a se. N am e,f unc (t *test in g. T){
      i sVa lid,  mess age := ReadFi eld (tes t Cas e.Inp ut.Fi rstS tr ing,testCa se.In pu t.SecondString,  tes tCase.Inp ut. So meB oo l)
        ifisValid != test C ase .E x p e ct ed.IsValid || mess ag e ! =testCase .Expec t ed .M e ssage {          t.Er r or f("Expec ted: % b ,%b  \n Got :%b, %b ",  te stC ase.E x pect ed.IsV alid, te stCas e .Expected.Mess a ge, isValid,m es s a ge ) 
          } els e {         t.Log f("Ex pe c te d : %b, %b \n Got: %b ,%b", t estCa se.Expected.I sValid, te s t C ase.Expe cted . Me s sage, isValid,  mess age)
          }       })      }
}
A : 

As the  er ror  in dic a t es , you need to i nclu de  the ty pein your  de cla rat ion .Since you 're usin gan on ym ous  type s , that m ea nsyo u m ust r e peat t he ty pe d ef in i tio n. This is , of c ou rs e, s upe rannoy ing:    //Vali d 
    {" Tes t  Cas e1" ,

   //Missing typ eerror 
   s tru ct{ 
     Fir stString     string 
      Se con dStri ng   string
      Som e Bool      bool   } { " First S t ri ng" ,"SecondStr i n g",  true }, 

  // etc ...

So what you s h oul d do is eithe r u se n a m ed  ty p es : 
ty pe tes t I nput struct{ 
   FirstSt ri n g    string 
  SecondS tring   str i ng 
   SomeBool         b oo l
}t y peexpected s truct{
   IsVali d  bool    Mes sag e stri ng 
}testC ases : =  [] struc t {
  Name    st ri ng
    I nput    testInput
    E xpecte d exp ect ed
}{
   // V ali d 
    {" Test  Case 1",
   / /Miss ing typeerro r    testI nput 
 to.

_ _   _ //Valid_
_ __  _ {"Test Case_1",

   _  __//Missing type error 
        {"FirstString", "SecondString", true},

__ ___  //Missing type error_
    _ _ {true, "testMessage"},},

     __ //Same goes_for the remaining

      _ {"Test Case 2", 
 _  ___ {"FirstString", "SecondString", false},
_     _ {true, "testMessage"},},

   _    {"Test Case 3",_
     _  {"FirstString", "SecondString", true},
_ _    _{false, "testMessage"},},
 _ _}

  _ for _, testCase := range_testCases{
  _     t.Run(testCase.Name,_func(t_*testing.T){
  ___ _  __ isValid,_message_:= ReadField(testCase.Input.FirstString, testCase.Input.SecondString, testCase.Input.SomeBool)
  __      _ if isValid!= testCase.Expected.IsValid_||_message!= testCase.Expected.Message {
 _    _     _ _ t.Errorf("Expected:_%b, %b \n Got: %b, %b", testCase.Expected.IsValid, testCase.Expected.Message, isValid, message)
 _     _   _} else_{
_  __ _      _ _t.Logf("Expected: %b, %b \n Got: %b,_%b", testCase.Expected.IsValid, testCase.Expected.Message, isValid,_message)
_     _     }
_    ___})  
  _ }
}

A:

As the error indicates, you_need to include_the type in your declaration. Since you're_using_anonymous types, that means you must_repeat_the type definition. This is, of_course,_super_annoying:
    //Valid_
    {"Test Case_1",

    //Missing type error 
 _  struct{_
    ___ FirstString     string 
  _ _  _SecondString    string 
    _   SomeBool   _    bool
    }{"FirstString", "SecondString", true},

_  // etc...

So what you should do_is either use named types:
type testInput struct{_
   _FirstString_    string 
 ___SecondString_  _string 
 _  SomeBool_ _  _ _bool
}
type expected struct{
__  IsValid bool
    Message string
}
testCases := []struct {
    Name  _  string
   _Input    testInput
__  Expected_expected
}{
   _//Valid 
    {"Test Case 1",

_   //Missing type error 
  __testInput