lundi 3 août 2020

How to expect for a json in go tests

I'm beginner in golang. The function I'm testing is returning a json, how can I write the exact json object I expect in the want field?

tests := []struct {
        name string
        args args
        want string
    }{
        {
            name: "success",
            args: args{ "XXX", "XXX" },
            want: "XXX",
        },

Aucun commentaire:

Enregistrer un commentaire