diff options
Diffstat (limited to 'lib/compilers/golang.ts')
-rw-r--r-- | lib/compilers/golang.ts | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/compilers/golang.ts b/lib/compilers/golang.ts index b1de66884..7db2d87e2 100644 --- a/lib/compilers/golang.ts +++ b/lib/compilers/golang.ts @@ -24,7 +24,10 @@ import _ from 'underscore'; +import {CompilerInfo} from '../../types/compiler.interfaces'; +import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces'; import {ResultLine} from '../../types/resultline/resultline.interfaces'; +import {unwrap} from '../assert'; import {BaseCompiler} from '../base-compiler'; import * as utils from '../utils'; @@ -55,7 +58,7 @@ export class GolangCompiler extends BaseCompiler { return 'golang'; } - constructor(compilerInfo, env) { + constructor(compilerInfo: CompilerInfo, env) { super(compilerInfo, env); const goroot = this.compilerProps<string | undefined>(`compiler.${this.compiler.id}.goroot`); const goarch = this.compilerProps<string | undefined>(`compiler.${this.compiler.id}.goarch`); @@ -219,21 +222,21 @@ export class GolangCompiler extends BaseCompiler { return []; } - override optionsForFilter(filters, outputFilename, userOptions) { + override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: string, userOptions?: string[]) { // If we're dealing with an older version... if (this.compiler.id === '6g141') { return ['tool', '6g', '-g', '-o', outputFilename, '-S']; } if (filters.binary) { - return ['build', '-o', outputFilename, '-gcflags=' + userOptions.join(' ')]; + return ['build', '-o', outputFilename, '-gcflags=' + unwrap(userOptions).join(' ')]; } else { // Add userOptions to -gcflags to preserve previous behavior. - return ['build', '-o', outputFilename, '-gcflags=-S ' + userOptions.join(' ')]; + return ['build', '-o', outputFilename, '-gcflags=-S ' + unwrap(userOptions).join(' ')]; } } - override filterUserOptions(userOptions) { + override filterUserOptions(userOptions: string[]) { if (this.compiler.id === '6g141') { return userOptions; } |