• Stars
    star
    523
  • Rank 81,425 (Top 2 %)
  • Language
    Go
  • License
    Other
  • Created over 9 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A gofmt/goimports-like tool for Go programmers that fills in Go return statements with zero values to match the func return types

This tool adds zero-value return values to incomplete Go return statements, to save you time when writing Go. It is inspired by and based on goimports.

short screencast

full 30-second screencast: http://youtu.be/hyEMO9vtKZ8

For example, the following incomplete return statement:

func F() (*MyType, int, error) { return errors.New("foo") }

is made complete by adding nil and 0 returns (the zero values for *MyType and int):

func F() (*MyType, int, error) { return nil, 0, errors.New("foo") }

To install:

go get -u github.com/sqs/goreturns

To run:

goreturns file.go

To view a diff showing what it'd do on a sample file:

goreturns -d $GOPATH/github.com/sqs/goreturns/_sample/a.go

Editor integration: replace gofmt or goimports in your post-save hook with goreturns. By default goreturns calls goimports on files before performing its own processing.

It acts the same as gofmt (same flags, etc) but in addition to code formatting, also fixes returns.

More Repositories

1

rhino

Ruby ORM for HBase - NOTE: I haven't maintained this in years.
Ruby
60
star
2

rego

reinstall and rerun a Go program when its source files change
Go
37
star
3

used

Go
32
star
4

go-elasticbeanstalk

AWS Elastic Beanstalk client (for Go) and command-line tool for easy binary deployment.
Go
30
star
5

go-selfupdate

Go
29
star
6

sbt-elasticbeanstalk

SBT Play2 plugin for deploying WAR files to Amazon Web Services (AWS) Elastic Beanstalk
Scala
24
star
7

mod_tcpcrypt

Passes Tcpcrypt session ID to Web apps running on Apache
C
13
star
8

godefinfo

godefinfo, given a location in a source file, prints information about the identifier's definition: package import path, parent type name (for methods and fields), and name.
Go
12
star
9

go-xoauth2

Go library for generating XOAuth2 strings (for use in XOAUTH2 SASL auth schemes for IMAP/SMTP)
Go
11
star
10

rider

Ruby Web crawler
Ruby
11
star
11

go-rexster-client

Go client for the Rexster graph server (part of the TinkerPop suite of graph database tools)
Go
10
star
12

grpccache

(WIP) grpccache provides caching for gRPC calls with HTTP-like semantics.
Go
9
star
13

pake

C implementation of PAKE2+
Shell
8
star
14

jspake

Javascript PAKE2+ implementation
JavaScript
7
star
15

go-synco

Email fetcher and JSON outputter in Go
Go
7
star
16

go2-generics-sample

Code copied from the Go 2 generics proposal
Go
6
star
17

go-mailutil

Email handling utility functions for Go: HTMLBody, TextBody, etc.
Go
6
star
18

openelections

software for running Stanford ASSU elections (NOTE: view the forks to find the most recent one -- this is the code we used for the 2011 elections)
Python
6
star
19

tlslite

my tlslite modifications (orig at http://trevp.net/tlslite/)
Python
6
star
20

gnutls

C
6
star
21

safebook

Sample Django app with TLS-SRP support
Python
6
star
22

freequery

freequery
Python
5
star
23

pbtypes

protobuf helper types (Timestamp, etc.)
Go
5
star
24

wordpress-tls-srp-authentication

TLS-SRP Authentication plugin for WordPress
PHP
5
star
25

avro-json

(NOTE: This has been merged into Avro trunk, in lang/js. Use that code from now on.) Avro JSON validator and Javascript record builder
JavaScript
5
star
26

fftcpcrypt

Firefox add-on for displaying Tcpcrypt session IDs of Web content
JavaScript
3
star
27

tcpcrypt-tests

Automated tcpcrypt tests
Python
3
star
28

sparseautoencoder

Sparse autoencoder benchmarks (CS 229)
Python
3
star
29

ffpake

Firefox HTTP PAKE auth
JavaScript
3
star
30

avro-dart

Avro schema parser for Dart (TODO: Avro codegen, validation, and JSON encoding/decoding)
Dart
3
star
31

pakeproxy

PAKE Proxy
C
3
star
32

apache-httpd

Apache httpd + TLS-SRP
C
3
star
33

nss

Mozilla NSS (Network Security Services)
C
3
star
34

openssl

OpenSSL (personal mirror)
C
2
star
35

mod_auth_pake

apache2 module for HTTP PAKE auth
C
2
star
36

mod_accountmanager

Apache module for Mozilla Account Manager (sets X-Account-Management-Status headers, etc.)
C
2
star
37

docs.sourcegraph.com

CSS
2
star
38

crtlslogin

Chrome TLS login extension
2
star
39

go-symb

modified go/sym
Go
2
star
40

gotags

Go
2
star
41

vscode-sqs-theme

My personal VSCode theme
Shell
2
star
42

fy9b2k22

2
star
43

hbase-tools

HBase schema visualizer
2
star
44

counter

counter
Go
2
star
45

mod_gnutls

mod_gnutls (unofficial)
C
2
star
46

avro-keyvalue

Avro flat map encoder and decoder (for storing nested Avro data structures in flat key-value stores)
Java
2
star
47

spans

A Go package for working with (possibly overlapping) spans in a string
Go
2
star
48

sqs.github.com

JavaScript
1
star
49

avro-scala-schema

Scala
1
star
50

oniguruma.js

JavaScript
1
star
51

fileset

Go
1
star
52

nodejs-test-package1

JavaScript
1
star
53

sample_go_app

Sample Go app that uses GOPATH-relative packages (for deployment testing)
Go
1
star
54

logfront

Log frontend for Amazon Elastic Beanstalk (Play 2.1 Scala)
Scala
1
star
55

gofiles

Go
1
star
56

sunrise

Library for creating client-server Web apps with Dart Web Components
Dart
1
star
57

dwc-library

Dart Web Components library of 3rd-party components
1
star
58

sourcegraph-word-count

A sample Sourcegraph extension for counting the number of words in a file.
TypeScript
1
star
59

sourcegraph-sample-actions

Sample Sourcegraph campaigns - https://docs.sourcegraph.com/user/automation
Dockerfile
1
star
60

about-wip

(WIP sandbox for work related to the sourcegraph/about repository)
1
star
61

sample-go-web-app

Basic sample Web app to test Go deployment
Go
1
star