<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:34:09 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[GODRIVER-410] IsZero and structs</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-410</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;It is currently not possible to flag a struct, i.e. time.Time as &apos;omitempty&apos; because IsZero() return false, due to the missing Zeroer implementation.&lt;/p&gt;

&lt;p&gt;Should IsZero also check if the given value is equals to the default value of the struct instead of return false in case of a non-implemented Zeroer interface?&lt;/p&gt;</description>
                <environment></environment>
        <key id="541084">GODRIVER-410</key>
            <summary>IsZero and structs</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="thomas.geulen">Thomas Geulen</reporter>
                        <labels>
                    </labels>
                <created>Tue, 8 May 2018 19:38:36 +0000</created>
                <updated>Thu, 17 May 2018 18:46:22 +0000</updated>
                            <resolved>Thu, 17 May 2018 18:46:22 +0000</resolved>
                                                    <fixVersion>0.0.5</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1894375" author="xgen-internal-githook" created="Thu, 17 May 2018 18:43:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;38960709+thomasgeulen@users.noreply.github.com&apos;, &apos;username&apos;: &apos;thomasgeulen&apos;, &apos;name&apos;: &apos;Thomas Geulen&apos;}
&lt;p&gt;Message: Merge branch &apos;master&apos; into &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-410&quot; title=&quot;IsZero and structs&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-410&quot;&gt;&lt;del&gt;GODRIVER-410&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/8daafecc60b87fc95ffc553424bf95b5a561617f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/8daafecc60b87fc95ffc553424bf95b5a561617f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1894374" author="xgen-internal-githook" created="Thu, 17 May 2018 18:43:48 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;thomas.geulen@csb.com&apos;, &apos;username&apos;: &apos;thomasgeulen&apos;, &apos;name&apos;: &apos;Thomas Geulen&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-410&quot; title=&quot;IsZero and structs&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-410&quot;&gt;&lt;del&gt;GODRIVER-410&lt;/del&gt;&lt;/a&gt;: Check for omitempty and IsZero before encoding the field.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/f76a79536aab22c0b249a3168f1999e929c749a9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/f76a79536aab22c0b249a3168f1999e929c749a9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1891722" author="kris.brandow" created="Tue, 15 May 2018 15:21:00 +0000"  >&lt;p&gt;Code Review: &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/54&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/pull/54&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="1888550" author="kris.brandow" created="Thu, 10 May 2018 19:58:26 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=thomas.geulen&quot; class=&quot;user-hover&quot; rel=&quot;thomas.geulen&quot;&gt;thomas.geulen&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;So the time.Time type does implement a bson.Zeroer, however, the place where we check for zero is after we have already encoded the time.Time value. You fixed this for checking for empty before inline, but it looks like we didn&apos;t move the check for omit empty up high enough. If you&apos;d like, send another PR and move the omitempty isZero line to here:&#160;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/2a25967215f361ca101688d23007a51eb787672d/bson/encode.go#L490&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/blob/2a25967215f361ca101688d23007a51eb787672d/bson/encode.go#L490&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you don&apos;t have availability to do so, let me know and I&apos;ll add it to our backlog. Thanks for the bug report!&lt;/p&gt;

&lt;p&gt;--Kris&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htolpr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>