summaryrefslogtreecommitdiff
path: root/app/models/packages/go
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/packages/go')
-rw-r--r--app/models/packages/go/module.rb4
-rw-r--r--app/models/packages/go/module_version.rb12
2 files changed, 8 insertions, 8 deletions
diff --git a/app/models/packages/go/module.rb b/app/models/packages/go/module.rb
index b38b691ed6c..00d51c21881 100644
--- a/app/models/packages/go/module.rb
+++ b/app/models/packages/go/module.rb
@@ -18,8 +18,8 @@ module Packages
end
def version_by(ref: nil, commit: nil)
- raise ArgumentError.new 'no filter specified' unless ref || commit
- raise ArgumentError.new 'ref and commit are mutually exclusive' if ref && commit
+ raise ArgumentError, 'no filter specified' unless ref || commit
+ raise ArgumentError, 'ref and commit are mutually exclusive' if ref && commit
if commit
return version_by_sha(commit) if commit.is_a? String
diff --git a/app/models/packages/go/module_version.rb b/app/models/packages/go/module_version.rb
index fd575e6c96c..c442b2416f1 100644
--- a/app/models/packages/go/module_version.rb
+++ b/app/models/packages/go/module_version.rb
@@ -17,15 +17,15 @@ module Packages
delegate :build, to: :@semver, allow_nil: true
def initialize(mod, type, commit, name: nil, semver: nil, ref: nil)
- raise ArgumentError.new("invalid type '#{type}'") unless VALID_TYPES.include? type
- raise ArgumentError.new("mod is required") unless mod
- raise ArgumentError.new("commit is required") unless commit
+ raise ArgumentError, "invalid type '#{type}'" unless VALID_TYPES.include? type
+ raise ArgumentError, "mod is required" unless mod
+ raise ArgumentError, "commit is required" unless commit
if type == :ref
- raise ArgumentError.new("ref is required") unless ref
+ raise ArgumentError, "ref is required" unless ref
elsif type == :pseudo
- raise ArgumentError.new("name is required") unless name
- raise ArgumentError.new("semver is required") unless semver
+ raise ArgumentError, "name is required" unless name
+ raise ArgumentError, "semver is required" unless semver
end
@mod = mod