Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/walah/go-csv-parser

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/walah/go-csv-parser

  • v0.0.0-20210204004903-5752db4adb8b
  • Source
  • Go
  • Socket score

Version published
Created
Source

CSV Parser in Go

I was working on a project where we had multiple services with in one project (e.g. Web, SafeKeeping, IOS, Call Notice, etc.). WEB was the front-end that will let the user upload the CSV file, and prepare it. After that, other services can collect the data using a POST request.

The whole CSV file parsing is devided into 2 parts...

  • MultipartWriter()
  • MultipartReader()

MultipartWriter

It converts the contents of the passed/received file into a multipart.Writer form file so the data can be passed to next service.

It returns the correct HTTP Content-Type, the form content as bytes, and a possible error.

(WEB service will collect the CSV file from the user, prepare it using MultipartWriter() and send it off to other/next service.)

MultipartReader

It reads the records from the passed/received CSV-encoded file and returns the parsed data (in a 2D String slice format) to the next service.

It also gives an option to include or exclude file header.

(Other services will collect the file/data from the POST request and parse it using the MultipartReader())

FAQs

Package last updated on 04 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc