<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ido Shveki on Medium]]></title>
        <description><![CDATA[Stories by Ido Shveki on Medium]]></description>
        <link>https://medium.com/@idoshveki?source=rss-8e8dba0c565c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nBsP_cQsIbhkQ8hP9HxWQg@2x.jpeg</url>
            <title>Stories by Ido Shveki on Medium</title>
            <link>https://medium.com/@idoshveki?source=rss-8e8dba0c565c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 08:44:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@idoshveki/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Make Your 1:1s the Most Efficient Tool in Your Toolbox]]></title>
            <link>https://idoshveki.medium.com/how-to-make-your-1-1s-the-most-efficient-tool-in-your-toolbox-f66d8e98e8e6?source=rss-8e8dba0c565c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f66d8e98e8e6</guid>
            <category><![CDATA[one-on-one]]></category>
            <category><![CDATA[management]]></category>
            <category><![CDATA[manager-development]]></category>
            <dc:creator><![CDATA[Ido Shveki]]></dc:creator>
            <pubDate>Sat, 06 Aug 2022 19:33:14 GMT</pubDate>
            <atom:updated>2022-08-07T07:14:26.854Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re a manager, but also an IC (individual contributor), I assume you spend a lot of time doing one-on-ones.<br>I’ll take another wild guess and assume that unless it’s critical to one of the sides — these 1:1s tend to get shortened, postponed or, God forbid, cancelled. <br>I’ll push it a little more and say that you sometimes ask yourself — “why do I do this? It feels like we’ve just talked, and this is quite an awkward situation to find myself in..”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*VjPkbDwMO8TsDP7CKxwTvA.jpeg" /></figure><p><strong>I find 1:1s to be the most efficient and powerful tool to do our job, as managers. </strong>Throughout the years I’ve been on both sides of this situation, and only recently I’ve formulated a strong opinion on how it needs to be done, based on experience and books (“<a href="https://www.amazon.com/MANAGER-SHORTS-Shocking-Management-Leadership/dp/0578731452">Manager in Shorts</a>” and “<a href="https://www.amazon.com/gp/product/0787960756/ref=ox_sc_act_title_1?smid=A3DCM1ZVT5PWYP&amp;psc=1">The Five Dysfunctions of a Team</a>”).</p><p><strong>Through 1:1 you can build trust.<br></strong>I cannot emphasize enough how much easier your job will be when your direct reports trust you and you trust them back. Perhaps I can do it on a different post, but now let’s talk about HOW these meetings should be conducted.</p><h3>The “Don’t Do”s on 1:1</h3><p>A 1:1 meeting isn’t the time to ask “what’s the progress on project A?”, nor is it the time to solve a technical issue the direct report (DR) was stuck upon.<br>I’ll say it again in different phrasing as this is critical: It’s not a sync or an update meeting. You should have plenty of other opportunities for that like daily standups, sprint checkups (either a talk or a tool for that) or just randomly asking “How’s project X coming along?”</p><p><em>So what should we talk about ?</em></p><h3>The “Do”s on 1:1</h3><p>Obviously you discuss the tasks, but the focus is on the employee, and the “why” (not accusing, just understanding together) and the “what” (what can we do to help).<br>I listed the things that should be achieved on 1:1s here below. Not all of them will appear on every 1:1.</p><ol><li><strong>Safe Space — </strong>whatever happens in the 1:1 room stays between you and the DR (direct report), unless, of course, you have action items (a raise, changes to our code-review methods, etc). This sounds easy, but what’s really easy here is to break this rule and lose a lot of trust points.</li><li><strong>Downward Feedback</strong> — Manager to DR. You and the team member should have a general growth plan (even if it’s not too detailed), and the 1:1 is a wonderful opportunity to point out recent (and sometimes small) events and give incremental feedback. It doesn’t matter if they are positive examples or examples for improvement, but for the latter, it is critical that it is passed on as constructive feedback.</li><li><strong>Upward Feedback</strong> — DR to Manager and the company/department. You should encourage your employees to share their thoughts on the company’s direction, the team structure and on you. You achieve two things here: <br>A. You can fix some of the issues or at least move towards a solution. If your employees see that you address the issues they raise, trust points are headed towards you.<br>B. You have the opportunity to eliminate these issues when they are small, before they have affected the entire team. Hence efficiency.</li></ol><h3>The Settings</h3><ul><li><strong>Frequency: <br></strong><em>The following section is relevant to managers who see their direct reports a few days a week and do not work 100% remotely.<br></em><strong>I do my 1:1s every other week. </strong>In my opinion, this maintains the “tension” between the parts. It makes the meeting more productive since both parties come more prepared and less exhausted. The DRs are motivated to share their thoughts even more since they know that if it’s not now — they will have to wait a month to say what they wanted to. <br>I’m very open and available for them at any time, and encourage them to schedule ad-hoc 1:1s, but it doesn’t happen very often.</li><li><strong>Time:<br></strong>I schedule between 30 and 45 minutes, and I leave 15 minutes open afterward. This is very helpful when we’re having a sensitive or open conversation and I don’t want to end it and resume later or tomorrow (as the settings can’t be recreated and this will lose its value). Also, having a few minutes after the 1:1 can resolve 80% of the issues raised by employees (e.g., setting up a meeting to discuss X, asking HR about Y, etc.).</li></ul><p>One last thing, if it wasn’t clear, I would like to emphasize<strong> </strong>that<strong> as the manager, you are responsible for the 1:1.</strong> The content, the fact that it’s happening and the followups.</p><h3>Summary</h3><p>By following these methods, you will be able to create a healthier culture, have more satisfied employees, and frankly have an easier time managing.</p><p>Sounds like a win-win-win, and trust me — it’s that simple.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f66d8e98e8e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Three “Clean Code” tips that will make your dev team 50% more efficient]]></title>
            <link>https://idoshveki.medium.com/three-clean-code-tips-that-will-make-your-dev-team-50-more-efficient-c4a3a0928914?source=rss-8e8dba0c565c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4a3a0928914</guid>
            <category><![CDATA[engineering-mangement]]></category>
            <category><![CDATA[junior-developer]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[clean-code]]></category>
            <dc:creator><![CDATA[Ido Shveki]]></dc:creator>
            <pubDate>Sun, 06 Mar 2022 21:22:37 GMT</pubDate>
            <atom:updated>2022-03-06T21:30:49.999Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*8W6_DGdg7UO9gcoTl-1pQw.jpeg" /></figure><p>If I had to choose one point from the “<a href="https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882">Clean Code</a>”, the bible of software engineering best practices, <strong>WE ARE AUTHORS </strong>would be it. The ratio of time spent reading vs writing is well over 10:1. Read that again. Slowly. We are constantly reviewing old code as part of the effort to write new code.</p><p>Since we spend so much time reading old code, it might be a good idea to invest a bit in making it simple and easy to understand, for us and our team.</p><p>Although I recommend reading the entire book, I find that the following three ideas are easy wins that can make a huge difference in your team’s productivity, efficiency, and most importantly — frustration reduction:</p><ol><li><strong>Use Good Names</strong></li></ol><p><strong>1.1. Intention Revealing: </strong>The name of a variable, function, or class, should tell you why it exists, what it does, and how it is used. If a name requires a comment, then the name does not reveal its’ intent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*jJHVDxfwUP-sBM7zVrjulw.png" /></figure><p><strong>1.2. Make Meaningful Distinctions: </strong>Don’t try to satisfy the compiler, If names must be different, then they should also mean something different. Imagine that you have a <strong><em>Product</em></strong> class. If you have another called <strong><em>ProductInfo</em></strong> or <strong><em>ProductData</em></strong>, you have made the names different without making them mean anything different.</p><p><strong>2. Avoid Functions Side Effects</strong></p><blockquote>FUNCTIONS SHOULD DO ONE THING. THEY SHOULD DO IT WELL. THEY SHOULD DO IT ONLY.</blockquote><p>With that in mind, we should avoid having side effects on our functions. Side effects are lies. Your function promises to do one thing, but it also does other hidden things. It can be making unexpected changes to the variables of its own class, or maybe modifying the parameters passed into the function or to system globals. In either case, they are devious and damaging mistruths that often result in strange temporal couplings and order dependencies.</p><p>Accordingly, in the example below, I would not expect the function to initialize the session, only to verify the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZrJVk7c3pBb1JT0c7Q7rbQ.png" /></figure><p><strong>3. Comment Only When Necessary</strong></p><p><strong>3.1. Explain Yourself in Code, Not Comments: </strong>One of the more common motivations for writing comments is bad code. Which would you rather see? <br>This:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fr4muboJs83z-UqCOkD7xA.png" /></figure><p>Or this?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cDyVdOAHmEsgo_0e_F0jRg.png" /></figure><p>Some more examples for bad comments that fall into the category of “trying to make up for bad code”:</p><ul><li>Redundant comments — it might take more time to read than the code.</li><li>Commented-out code — please don’t do this. Others who see that won’t have the courage to delete it. They’ll think it is there for a reason and is too important to delete.</li><li>Too Much Information — Don’t put interesting historical discussions or irrelevant descriptions of details into your comments.</li></ul><p><strong>3.2 Comments Lie: </strong>Not always, and not intentionally, but too often. The older a comment is, and the farther away it is from the code it describes, the more likely it is to be just plain wrong. The reason is simple. Programmers can’t realistically maintain them. <br>Code changes from time to time and might also be reviewed by team members before the change is committed. Unfortunately, comments sometimes fall between the cracks, forgotten in the past, still explaining something that just isn’t there. In addition, chunks of code can move from here to there, while their comments don’t always follow and become orphaned blurbs of ever-decreasing accuracy.<br>It is possible to make the point that programmers should be disciplined enough to keep the comments in a high state of repair, relevance, and accuracy. I agree, they should. But I would rather that energy go toward making the code so clear and expressive that it does not need the comments in the first place.<br><strong>Truth can only be found in one place: the code.</strong></p><p>To sum things up, if you want to dramatically improve your team’s productivity, remember and apply these three “clean code” principles:</p><ol><li><strong>Use Good Names</strong></li><li><strong>Avoid Functions Side Effects</strong></li><li><strong>Comment Only When Necessary</strong></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4a3a0928914" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Upgrading React Native v0.59 to v0.62]]></title>
            <link>https://idoshveki.medium.com/upgrading-react-native-v0-59-to-v0-62-f135f55c56ef?source=rss-8e8dba0c565c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f135f55c56ef</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[react-native-upgrade]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Ido Shveki]]></dc:creator>
            <pubDate>Sun, 07 Jun 2020 09:37:58 GMT</pubDate>
            <atom:updated>2020-06-17T17:00:58.901Z</atom:updated>
            <content:encoded><![CDATA[<p>A year ago, I was building an iOS app using <strong>React-Native &amp; Firebase</strong>. I made sure I was on the latest RN release as I knew these upgrades on react-native can get messy.</p><p>All was great, react-native linking, cocoa-pods install, until I left it for a year…</p><p>A few days ago, when I tried to revive what’s left of it and consulted a friend, I realised making the iOS build pass again is not going to be quick.</p><p>I’m going to walk you through some of the challenges I’ve encountered, knowing there’s probably thousands more, hopefully some of it will help some of you with your migrations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*JirOxgrCyLDFO5PXowGs-w.jpeg" /></figure><h3>tl;dr</h3><ol><li>Manually <strong>upgrade to the desired release</strong> and make the required changes using the <a href="https://react-native-community.github.io/upgrade-helper/">react-native-upgrader </a>.</li><li>Upgrade to the <strong>newest </strong><a href="https://rnfirebase.io/migrating-to-v6"><strong>react-native-firebase</strong></a> (the migration from 5.x to 6.x requires some attention)</li><li><strong>Sync cocoapods</strong> (pod install &amp;&amp; pod update)</li><li><strong>Build</strong> project (npx react-native run-ios)</li><li>(Fix failures)</li></ol><blockquote><em>Want to read this story later? Save it in </em><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=blog&amp;utm_campaign=noteworthy&amp;utm_content=eid7"><em>Journal</em></a><em>.</em></blockquote><h3>First step - Manual Changes:</h3><ul><li>One of the winning argument in favour of react-native compared to Flutter is its community. They’ve built the <a href="https://react-native-community.github.io/upgrade-helper/">react-native-upgrader</a>, a nice tool for assisting engineers making these existing-project-migrations.</li><li>Here I suggest to upgrade to the newest release. no one likes to make these migration, so make this time counts for the longest possible.</li><li>Notice that the tool gives you a full project, so carefully when migrate files that you touched, not to delete important features from your project (podfile, App.js .. )</li></ul><h3>React Native Firebase Upgrade</h3><ul><li>In case you’re using React Native Firebase v5 and below, use this opportunity to upgrade to 6.x.x.</li><li>The community comes to rescue again, with these<a href="https://rnfirebase.io/migrating-to-v6"> detailed upgrade instructions</a></li></ul><h3>Podfile (CocoaPods)</h3><blockquote>The Podfile is a specification that describes the dependencies of the targets of one or more Xcode projects (taken from the <a href="https://guides.cocoapods.org/using/the-podfile.html">cocoapods guide</a>)</blockquote><ul><li>React-Native now uses <a href="https://reactnative.dev/docs/integration-with-existing-apps">Cocoapods</a> by default which means no “react-native link {package-name}” should be run.</li><li>We should still verify that all pods in the podfile have a <em>.podspec</em><strong><em> </em></strong>file in the corresponding package folder under node_modules, and specify the path on the podfile:</li></ul><pre>pod &#39;react-native-camera&#39;, path: &#39;../node_modules/react-native-camera&#39;</pre><pre>pod &#39;React-ART&#39;, :path =&gt; &#39;../node_modules/react-native/Libraries/ART&#39;</pre><ul><li>If a package doesn’t have a .<em>podspec</em> file, try upgrading to a newest version of that package that supports Cocapods. If it’s still missing, <a href="https://reactnative.dev/docs/linking-libraries-ios#manual-linking">add it manually</a> .</li><li>Run, like always: pod install &amp;&amp; pod update</li></ul><h3>Build</h3><pre>npx react-native run-ios</pre><p>if this works for you.. well, you’re the luckiest engineer. Please comment below so I’d know it actually happened.</p><h3>Build failures I’ve encountered</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*LoOzgM7Aa39Hcle6F0xc6Q.jpeg" /><figcaption>still with me ?</figcaption></figure><ul><li><em>[FAIL] id: library not found for -l{lib-name} <br>error: linker command failed with exit code 1 (use -v to see invokation)</em></li></ul><ol><li>Add all new libraries to <strong>Build Phases -&gt; Link Binary With Libraries </strong>(see screenshot)<strong>, </strong>based on podfile, and remove the ones XCode complains about not finding</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vj0zUAztxk5bXTS3tCJcRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ky5TARiv-Smxi3baT7YdqQ.png" /></figure><p>2. Remove all ‘.xcodeproj’ files that Xcode still complains about as unrecognisable from Libraries (screenshot)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*goO2mciusDEzVrd1knzFVA.png" /></figure><p>3. Delete <em>node_modules</em> library and re-run <em>npm install </em>(or yarn)</p><p>4. pod install &amp;&amp; pod update</p><ul><li><em>[FAIL] </em>No bundle URL present.<em><br></em>Make sure you&#39;re running a packager server or have included a .jsbundle file in your application bundle.</li></ul><p>(Taken from this<a href="https://stackoverflow.com/questions/43854369/no-bundle-url-present-error-with-react-native-ios-release-mode"> Stack Overflow thread</a>)</p><ol><li>run:react-native bundle --dev false --platform ios --entry-file index.ios.js --bundle-output ios/main.jsbundle --assets-dest ./ios</li><li>Add main.jsbundle and assets directory to xcode by dragging them in your project.</li></ol><h3>Done?</h3><p>If you’re lucky enough you’ll witness this magnificent icon</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*6wt54e7d1hpYp5NfWMWgGQ.png" /></figure><p>Hopefully this will help some of you with their struggle!</p><p>Good luck and feel free to contact or comment with follow up questions or stuff that didn’t go according to what I wrote</p><p>📝 Save this story in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f135f55c56ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing a CSV in Go]]></title>
            <link>https://idoshveki.medium.com/writing-a-csv-in-go-bbe19473fba8?source=rss-8e8dba0c565c------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbe19473fba8</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[test]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[csv]]></category>
            <category><![CDATA[export]]></category>
            <dc:creator><![CDATA[Ido Shveki]]></dc:creator>
            <pubDate>Sat, 10 Aug 2019 22:15:43 GMT</pubDate>
            <atom:updated>2019-08-10T22:15:43.515Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Hi you.. I bet you want to generate all this data into a CSV don’t you?</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d4hdBRMaH3xffTNAq4m_QQ.jpeg" /></figure><p>The need for generating a CSV and downloading it from the server is quite often when working with data and having the products’ clients demand for a certain report.</p><p>Lets’ see how easy it is —</p><ul><li>In this article I assume using with “encoding/csv” package and working with an http response :)</li><li>I also added way to test your http handler and handle errors on the request level.</li></ul><p>Hope you like it, please contact for any feedback (good or bad)</p><ol><li>Setting the response headers</li></ol><p>We first need to tell the browser (or any client that’s receiving the request) what’s the type of the response they’re getting and in what form</p><pre>// assuming var w http.ResponseWriter<br>....<br>w.Header().Set(&quot;Content-Disposition&quot;, &quot;attachment; filename=export.csv&quot;)<br>w.Header().Set(&quot;Content-Type&quot;, &quot;text/csv&quot;)<br>w.Header().Set(&quot;Transfer-Encoding&quot;, &quot;chunked&quot;)</pre><p>In other words:</p><blockquote>Hi, I’m sending you an attachment in the response, it is of type CSV and is named “export.csv”. It’s going to be divided into chunks so no worries if you don’t get it all at once, just keep waiting and don’t you close that response in the meantime”</blockquote><p>2. Fetching you data</p><p>Now is the time to get the data from dB or any place you wish. Two issues (I can think of) you might encounter while trying to get the data are:</p><p>a. Getting the request context, in order to be able to talk to db etc. it’s as simple as:</p><pre>// assuming var r http.Request<br>ctx := r.Context()</pre><p>b. Getting get params sent in the URL</p><pre>param := r.URL.Query().Get(&quot;param&quot;)<br>// if param was not sent -&gt; param == &quot;&quot;</pre><pre>//OR</pre><pre>param, ok := r.URL.Query()[&quot;param&quot;]<br>// if param was not sent → ok == false</pre><p>3. Writing to the CSV</p><p>Assuming I want to generate a file with the following data.</p><pre>| First Name  | Last Name | Age   | Email                   |<br>|-------------|-----------|-------|-------------------------|<br>| Frodo       | Baggins   | 33    | fbaggins@fellowship.com | <br>|-------------|-----------|-------|-------------------------|<br>| Gandalf     | The White | 11,000| thegray@fellowship.com  |</pre><p>I’ll just have to have each row in a slice, and that’s about it.</p><pre>writer := csv.NewWriter(w)<br>err := writer.Write([]string{&quot;First Name&quot;, &quot;Last Name&quot;, &quot;Age&quot;, &quot;Email&quot;})<br>// err check<br>err = writer.Write([]string{&quot;Frodo&quot;, &quot;Baggins&quot;, &quot;33&quot;, &quot;fbaggins@fellowship.com&quot;})<br>// err check<br>err = writer.Write([]string{&quot;Gandalf&quot;, &quot;The White&quot;, &quot;11,000&quot;, &quot;thegray@fellowship.com&quot;})<br>// err check</pre><pre>writer.Flush()</pre><p>and that’s about it in terms of creating the file! but…</p><p>Some important nits I’de like to add</p><p>4. Error handling</p><p>Again, super intuitive and easy, but you’ll just need to write the error to the response, so that you can deal with it on the client:</p><pre>// assuming var w http.ResponseWriter</pre><pre>if err != nil {<br>  http.Error(w, &quot;cannot write to file&quot;, http.StatusInternalServerError)<br>return<br>}</pre><p>Or any of the relevant status code, which can be found in details here: <a href="https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml">https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml</a></p><p>5. Test</p><p>The most important one that we all tend to forget and hoping no one will notice.</p><p>(I’ll have another detailed article dedicated for that, for now I’ll just write the essence):</p><ul><li>We’ll be using httptest package.</li><li>“exportExample” in this example is the function you created before, or any function that receives a http.ResponseWriter and a *http.Request (what we want to test)</li></ul><pre>func exportExample(w http.ResponseWriter, r *http.Request) {...}</pre><pre>func TestExport(t *testing.T) {<br>  server := httptest.NewServer(exportExample)<br>  defer server.Close()</pre><pre>  eq, err := http.NewRequest(http.MethodGet, server.URL, nil/*body of request*/)<br>  require.NoError(t, err)<br>  // Setting headers if needed<br>  req.Header.Set(&quot;key&quot;, &quot;value&quot;)</pre><pre>  res, err := http.DefaultClient.Do(req)<br>  require.NoError(t, err)<br>  defer res.Body.Close()</pre><pre>  reader := csv.NewReader(res.Body)<br>  // Looping over the file row by row<br>  for {<br>   ln, err := reader.Read()<br>   if err == io.EOF {<br>      break<br>   }<br>   require.NoError(t, err, &quot;error reading row&quot;)<br>   // test logic  <br>}</pre><p>That’s it.</p><p>Hope I helped you implement a CSV generator in Go, and if so, in a high quality!</p><p>Thanks for sticking till here, lmk what you think with either claps or any feedback, really expecting this (good and bad).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbe19473fba8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>