Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12176)

Issue 96850044: code review 96850044: go.tools/imports: If func main() exists, add package de...

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years ago by smwca
Modified:
10 years ago
Reviewers:
crawshaw1, bradfitz
CC:
bradfitz, crawshaw1, golang-codereviews
Visibility:
Public.

Description

go.tools/imports: If func main() exists, add package declaration Assuming: 1) package declaration does not exist 2) the Fragment option is set 3) a main function exists We will assume it is a main package and add the declaration. This change also sets the Fragment option in goimports.

Patch Set 1 #

Patch Set 2 : diff -r f8e4c8ae7a71 https://code.google.com/p/go.tools #

Patch Set 3 : diff -r f8e4c8ae7a71 https://code.google.com/p/go.tools #

Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -3 lines) Patch
M cmd/goimports/goimports.go View 1 1 chunk +1 line, -0 lines 0 comments Download
M imports/fix_test.go View 1 2 chunks +27 lines, -1 line 0 comments Download
M imports/imports.go View 1 2 chunks +32 lines, -2 lines 0 comments Download

Messages

Total messages: 4
smwca
Hello bradfitz@golang.org (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go.tools
10 years ago (2014-04-27 02:04:49 UTC) #1
crawshaw1
LGTM, FWIW
10 years ago (2014-04-28 21:11:29 UTC) #2
bradfitz
LGTM
10 years ago (2014-04-28 21:14:29 UTC) #3
bradfitz
10 years ago (2014-04-28 21:15:37 UTC) #4
*** Submitted as
https://code.google.com/p/go/source/detail?r=e4cb80ed8405&repo=tools ***

imports, cmd/goimports: add missing package main if func main exists

Assuming:
        1) package declaration does not exist
        2) the Fragment option is set
        3) a main function exists

We will assume it is a main package and add the declaration.

This change also sets the Fragment option in goimports.

LGTM=crawshaw, bradfitz
R=bradfitz, crawshaw
CC=golang-codereviews
https://codereview.appspot.com/96850044

Committer: Brad Fitzpatrick <bradfitz@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b