-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Revert the minimal golang version requirement from 1.17 to 1.16 and add a warning in Makefile #19319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
techknowlogick
merged 6 commits into
go-gitea:release/v1.16
from
lunny:lunny/min_go_version
Apr 5, 2022
Merged
Revert the minimal golang version requirement from 1.17 to 1.16 and add a warning in Makefile #19319
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cf63703
Revert the minimal golang version requirement from 1.17 to 1.16 and a…
lunny a645c66
Apply suggestions from code review
lunny 4cb2e91
1.16
techknowlogick 396fe89
Update modules/util/net.go
techknowlogick 92b8968
correct bool conditional
techknowlogick 6934e8d
Update hostmatcher.go
techknowlogick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module code.gitea.io/gitea | ||
|
||
go 1.17 | ||
go 1.16 | ||
|
||
require ( | ||
cloud.google.com/go v0.99.0 // indirect | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2021 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package util | ||
|
||
import ( | ||
"net" | ||
) | ||
|
||
// IsIPPrivate for net.IP.IsPrivate. | ||
func IsIPPrivate(ip net.IP) bool { | ||
if ip4 := ip.To4(); ip4 != nil { | ||
return ip4[0] == 10 || | ||
(ip4[0] == 172 && ip4[1]&0xf0 == 16) || | ||
(ip4[0] == 192 && ip4[1] == 168) | ||
} | ||
return len(ip) == net.IPv6len && ip[0]&0xfe == 0xfc | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it very strange for a user who uses Go1.18 see this WARNING?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently yes, but when Golang go to 1.2x, it will not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we leave this, we can expect other issues with why this warning is appearing for users that are using the latest go version. We don't want to let them think that they are using a outdated go version when they are not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we will never know it except we check Golang's website in the Makefile.