Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
github.com/reiver/go-indent
Package indent provides tools for indentation of UTF-8 text, for the Go programming language.
For example, if you take some text, package indent can make it so it puts tabs, or spaces for indentation in front of each non-empty line.
So, for example, this:
Hello world!
I came; I saw; I conquered.
Can becomes this:
Hello world!
I came; I saw; I conquered.
Or:
Hello world!
I came; I saw; I conquered.
Or:
-----Hello world!
-----I came; I saw; I conquered.
You can specify how much indentation you want, and what you want the indentation to be (ex: tabs, spaces, or any other symbol, or string).
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-indent
import "github.com/reiver/go-indent"
// ...
var writer io.Writer
// ...
var indentationWriter indent.Writer
indentationWriter.Indentation = "\t\t"
indentationWriter.Writer = writer
// ...
var s string =
"This is a sentence.\n"+
"This is another sentence.\n"+
"\n"+
"This is a new paragraph.\n"
// ...
io.WriteString(&indentationWriter, s) // <---- Note we write to the ‘indentationWriter’, and not ‘writer’.
// Result will be:
//
// "\t\tThis is a sentence.\n"+
// "\t\tThis is another sentence.\n"+
// "\n"+
// "\t\tThis is a new paragraph.\n"
//
// Note the "\t\t" indentation in front of each non-empty line.
//
// Note the empty line (i.e., "\n") did not get indentation.
FAQs
Unknown package
Did you know?
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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.