From b449598bff32402f9acab6dd34d6093aea8c527c Mon Sep 17 00:00:00 2001 From: Ruben Mennes Date: Thu, 17 Nov 2022 17:20:30 +0100 Subject: [PATCH] Revert gqlgen file --- gqlgen.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gqlgen.go b/gqlgen.go index ba24a5f..45dddbb 100644 --- a/gqlgen.go +++ b/gqlgen.go @@ -1,24 +1,23 @@ package main // Arguments to format are: -// // [1]: type name const gqlgenMethods = ` // MarshalGQL implements the graphql.Marshaler interface for %[1]s func (i %[1]s) MarshalGQL(w io.Writer) { - fmt.Fprint(w, strconv.Quote(i.String())) + fmt.Fprint(w, strconv.Quote(i.String())) } // UnmarshalGQL implements the graphql.Unmarshaler interface for %[1]s func (i *%[1]s) UnmarshalGQL(value interface{}) error { - str, ok := value.(string) - if !ok { - return fmt.Errorf("%[1]s should be a string, got %%T", value) - } + str, ok := value.(string) + if !ok { + return fmt.Errorf("%[1]s should be a string, got %%T", value) + } - var err error - *i, err = %[1]sString(str) - return err + var err error + *i, err = %[1]sString(str) + return err } `