Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ type file interface {

// replaced by testing functions.
var openFile = func(name string) (file, error) {
return os.OpenFile(name, os.O_RDWR, 0666)
// The permission bits (third argument) are only used when O_CREATE is set.
// Since we only open existing files, 0 is passed to make that clear.
return os.OpenFile(name, os.O_RDWR, 0)
}

func processFile(path string, rewrite, doDiff bool) (foundDiff bool, err error) {
Expand Down
3 changes: 1 addition & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to writing, software distributed
// under the License is distributed on a "AS IS" BASIS, WITHOUT WARRANTIES OR
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
Expand Down Expand Up @@ -120,7 +120,6 @@ func TestEmbedFiles(t *testing.T) {
if got := f.buf.String(); tt.out != got {
t.Errorf("case [%s]: expected output \n%q; got\n%q", tt.name, tt.out, got)
}

}
}

Expand Down
Loading